Understanding Custom Fields
Custom fields in Snipe-IT work differently than typical custom field implementations:When you create a custom field, Snipe-IT automatically adds a new column to the
assets table in your database. The column name follows the format _snipeit_fieldname_id.- Custom Field - The individual field definition (e.g., “MAC Address”)
- Fieldset - A group of related fields (e.g., “Network Equipment Fields”)
- Asset Model - Associates fieldsets with specific types of assets (e.g., “Cisco Switch”)
Creating Custom Fields
Step 1: Navigate to Custom Fields
Go to Settings (gear icon) > Custom Fields in the admin interface.Step 2: Create a New Field
Click Create New Field and configure the following:The field name (e.g., “MAC Address”, “Warranty Expires”). This becomes the label shown to users.
The type of input element:
- Text - Single-line text input
- Textarea - Multi-line text area
- Listbox - Dropdown selection
- Checkbox - Multiple choice checkboxes
- Radio - Single choice radio buttons
Validation format for the field:
- ANY - No validation
- ALPHA - Letters only
- ALPHA-DASH - Letters, numbers, dashes, underscores
- NUMERIC - Numbers only
- ALPHA-NUMERIC - Letters and numbers
- EMAIL - Valid email address
- DATE - Valid date format
- URL - Valid URL
- IP - Valid IP address (v4 or v6)
- IPV4 - Valid IPv4 address
- IPV6 - Valid IPv6 address
- MAC - Valid MAC address (00:00:00:00:00:00)
- BOOLEAN - True/false value
- CUSTOM REGEX - Your own regular expression
Available Validation Formats
The validation formats are defined inapp/Models/CustomField.php:24-39:
Field Options
For listbox, checkbox, and radio fields, specify options in this format:If you omit the display text, the value will be used as the label.
Encrypt the field value in the database. Useful for sensitive information like license keys or passwords.Note: Encrypted fields cannot be displayed in list views or emails.
Enforce uniqueness across all assets. Useful for fields like MAC addresses or serial numbers.
Optional help text displayed below the field to guide users.
Display Settings
Display this field as a column in the main asset listing table.
Include this field value in checkout/checkin notification emails.
Display this field when users view their assigned assets.
Show this field in the list of requestable assets.
Workflow Settings
Show this field in the checkout form, allowing values to be set during checkout.
Show this field in the checkin form.
Include this field in the audit workflow.
Automatically add this field to all new fieldsets.
Working with Fieldsets
Creating a Fieldset
- Go to Settings > Custom Fields > Fieldsets
- Click Create New Fieldset
- Name your fieldset (e.g., “Computer Custom Fields”)
- Select the custom fields to include
- Save the fieldset
Associating Fieldsets with Asset Models
- Navigate to Settings > Asset Models
- Edit or create an asset model
- In the Fieldset dropdown, select the appropriate fieldset
- Save the model
Example Use Cases
Network Equipment
Create a fieldset for switches and routers:- MAC Address (Text, MAC format, unique)
- Management IP (Text, IPV4 format)
- VLAN Configuration (Textarea)
- Port Count (Text, Numeric format)
Computers
Create a fieldset for laptops and desktops:- Warranty Expires (Text, Date format)
- BitLocker Recovery Key (Text, Encrypted)
- RAM Capacity (Listbox: 4GB|4 GB, 8GB|8 GB, 16GB|16 GB, 32GB|32 GB)
- Operating System (Radio: win11|Windows 11, win10|Windows 10, macos|macOS)
Mobile Devices
Create a fieldset for phones and tablets:- Phone Number (Text)
- IMEI (Text, unique)
- Carrier (Listbox: verizon|Verizon, att|AT&T, tmobile|T-Mobile)
- MDM Enrolled (Checkbox)
Field Encryption
When you enable Encrypt Field, Snipe-IT uses Laravel’s encryption to secure the data using yourAPP_KEY.
Encrypted fields:
- Cannot be displayed in list views
- Cannot be included in emails
- Cannot be displayed on user-facing views
- Require the
assets.view.encrypted_custom_fieldspermission to view
Setting Default Values
You can set default values for custom fields on a per-model basis:- Navigate to Settings > Asset Models
- Edit the asset model
- Click on the custom field name
- Enter a default value
- Save the model
Database Structure
Custom fields are stored as additional columns on theassets table. The column naming convention is:
app/Models/CustomField.php:127-189.
Permissions
Custom field management requires specific permissions defined inconfig/permissions.php:334-351:
customfields.view- View custom fieldscustomfields.create- Create new custom fieldscustomfields.edit- Edit existing custom fieldscustomfields.delete- Delete custom fields
API Access
Custom field values are included in the asset API responses:Best Practices
Plan your field structure - Design fieldsets based on asset categories rather than creating individual fields for every asset.
Use appropriate validation - Apply format validation to ensure data quality (e.g., MAC format for MAC addresses).
Limit encrypted fields - Only encrypt truly sensitive data, as encrypted fields have display limitations.
Set meaningful help text - Guide users on what to enter and in what format.
Troubleshooting
Field Not Showing on Asset Form
- Verify the field is associated with a fieldset
- Verify the fieldset is associated with the asset’s model
- Check that workflow settings (Display on Checkout, etc.) are enabled if needed
Validation Errors
If custom REGEX validation fails, test your regular expression. The pattern is wrapped with^ and $ automatically:
Cannot Delete Field
Fields cannot be deleted if they’re associated with any fieldsets. First remove the field from all fieldsets, then delete it.Next Steps
Categories
Organize assets by category type
Asset Models
Create models and associate fieldsets
API Documentation
Access custom fields via the API
Reports
Generate reports including custom field data
