Overview of creating and updating custom fields.
Overview
In Zylo, customizable fields can be created for applications. These fields (referred to commonly as "Custom Fields") allow for users to create their own updateable and filterable fields that are attached to the application.
Below is a table describing how each type of custom field:
| Type | Description |
|---|---|
boolean | Equivalent to the Yes/No type as seen in the Zylo App. |
choice | Equivalent to the Dropdown type as seen in the Zylo App. |
currency | Choose this to have the field treated and validated as a currency |
date | Choose this to have the field treated and validated as a date |
email | Choose this to have the field treated and validated as an email |
number | Choose this to have the field treated and validated as a number |
text | Choose this to have the field treated and validated as text |
Note on the options Property
options PropertyWhen retrieving a Custom Field from either the List or the By ID routes the individual record's options will have varying shapes:
If boolean type
{
...
"type": "boolean",
"options": {
"default": "Yes",
"options": [
"Yes",
"No",
"Not Specified (-)"
]
},
...
}If choice type
{
...
"type": "choice",
"options": {
"default": "value1",
"options": [
"value1",
"value2",
"value3"
]
"disabled_options": []
},
...
}For all other types; currency, date, email, number, and text
{
...
"type": "text",
"options": {},
...
}Creating a Custom field
Choosing the boolean type
boolean typeWhen creating a boolean type the options top level property must take the shape:
{
...
"type": "boolean",
"options": {
"default": "Yes", // or "No" or "Not Specified (-)"
"options": [
"Yes",
"No",
"Not Specified (-)"
]
},
...
}The options array must contain the values Yes, No, Not Specified (-), or a subset of those three.
The default may be omitted, null, or empty string ''. However if one of those values are pass the default will be set to Not Specified (-).
Choosing the choice type
choice typeWhen creating a choice type the options top level property must take the shape:
{
...
"type": "choice",
"options": {
"default": "value1", // or "value2" or "value3"
"options": [
"value1",
"value2",
"value3"
]
},
...
}The default may be omitted, null, or empty string ''. However if any other value then it must be present in the options array.
NOTE: the disabled_options array cannot be modified through the API.
disabled_options array cannot be modified through the API.Choosing currency, date, email, number, and text types
currency, date, email, number, and text typesWhen choosing one of these types the options property can be omitted, null, or an empty object {}.
Updating a Custom field
Currently only the description, is_enabled, and position are the only properties that can be updated at this time.