Custom Fields
Device42 offers users the ability to define their own fields.
You can add custom fields to buildings, rooms, racks, customers, devices, assets, application components, circuits, and passwords as discussed below. This feature enables you to store any custom attributes you need to store in Device42. You can also display custom fields and filter on custom fields in Reports.
Adding Custom Fields
Navigate to the Custom Fields list page under Tools > Custom Fields and click on a custom field object type (for example, Assets or Devices).


-
From the list page for the selected custom field type, you can either edit an existing custom field or click the Create button to add a new one.
-
Input the name for the custom field and choose its data Type. Certain custom field types, when selected, will present more options specific to that field type. The available types are listed below.
- Text: These fields use character-based values.
- Number: These fields use numeric values.
- Date: These fields use calendar date formatting.
- Related Field: These fields use the values of other fields (for example, if Rack is chosen, then rack names are possible values).
- Yes/No: These fields use yes or no values.
- URL: These fields use URL values.
- Picklist: These fields use values chosen from a picklist.
- You can create either single-select or multi-select picklists.
- After creation, you can adjust the picklist parameters without needing to recreate and reassign custom fields.
- JSON: These fields use JSON formatting.
- Markup: These fields use markup formatting.


-
If you check the Filterable box, the list view page for the object type (for example, Devices) will contain the custom field as a filter option, which allows you to filter the list view by the custom field value. You can find the filterable custom field in the More Filters dropdown.
-
If a custom field is marked as Mandatory, the device (or other object) record can only be saved once a custom field value has been entered, as shown below. Please note that the field is only enforced as mandatory when objects are edited or added via the UI. The field is not mandatory when objects are edited or added via the API.
Bulk Set Custom Field Values
Set custom field values in bulk using the Set Custom Field Value action, which is available on most list pages from the Actions dropdown.


-
Search for the custom field you want to set values for and input the necessary value(s). You can also add a note if desired.
Create a Custom Field for Secrets
You can add a Custom Field to the Secrets form to store additional values.
-
Navigate to Tools > Custom Fields and click on the Secrets link.
-
Name the custom field, choose its data Type, whether it is Filterable, and whether it is Mandatory. By default, the custom field is set to Log for API, which means any changes made to this custom field via the Device42 API will be recorded in the history log.
-
You can now assign a value to the newly created custom field when creating a new Secret, and add a note if desired.
REST APIs for Custom Values
You can find the documentation for adding Custom Fields to various objects using the API in the API Documentation.
For example, to see the API documentation for adding custom fields to Devices, navigate to Devices > Custom fields.
Assigning Related Field Values by Object ID
You can populate a related custom field by sending the object ID instead of its name.
Add two form parts to your POST
or PUT
request:
Field | Required | Value |
---|---|---|
value | ✔ | Numeric ID of the related object (for example, an end user ID). |
related_field_value_by_id | ✔ | yes tells Device42 that value contains an ID, not the object name. |
Click to expand the code block
curl -k -X PUT -u 'admin:adm!nd42' \
-F "name=Customer 101" \
-F "key=end_user_details" \
-F "type=related_field" \
-F "related_field_name=endusers" \
-F "value=6" \
-F "related_field_value_by_id=yes" \
https://<device42>/api/1.0/custom_fields/customer/
The call above sets End User Details to the end user whose object ID is 6.
For full parameter details, read the documentation for the Customers endpoint.
Exago Reports Note
For Exago reports (which are not enabled by default), we've made changes to a couple of custom field data types that may affect existing queries. Custom numeric and date fields are now represented as DATE
and BIGINT
instead of TEXT
, which might affect existing queries. Queries containing TEXT
-related builtins, like SUBSTRING
, may fail and need to be updated using the updated data type. Queries with basic operators in the WHERE
clause, like =
and <>
, should all continue without issues.