A Custom Form adds extra fields to a Person, Reader, Controller or Access Level. For example, an “HR Info” form might add an Employee Number field to every Person.
This page answers two questions:
Once you know both, your integration can read and write those values through the API.
In the examples, {base} is the regional API address and {folder} is the key of the instance root folder.
A Custom Form is stored as a Generic object. The Generic says which object type the form is for (Person, Reader, Controller or Access Level) and lists the fields.
When a user opens a Person in the UI, the UI:
Person.Metadata array.One object type can have many forms. Each form keeps its values in its own Metadata entry.
There are two kinds of form definition. Older forms have TypeName: "CustomForm". Newer forms have TypeName: "CustomFormSpec". You will often see both in one instance, so handle both.
Over REST, Values comes back as a JSON string. The examples below show it decoded so it is easier to read.
{
"CommonName": "HR Info",
"TypeName": "CustomForm",
"ShouldPublishUpdateEvents": true,
"Values": {
"ApplicationName": "HR Info",
"Editor": 1,
"XmlLayout": "<DataLayoutControlEx><Element ID=\"TextBox…\" Label=\"Employee Number\" /> …</DataLayoutControlEx>"
}
}
{
"CommonName": "HR Info",
"TypeName": "CustomFormSpec",
"ShouldPublishUpdateEvents": true,
"Values": {
"ApplicationName": "HR Info",
"Person": "[{\"type\":\"TextFormFieldWidget\",\"label\":\"Employee Number\",\"isRequired\":true}, …]"
}
}
| Target type | CustomForm → Values.Editor |
CustomFormSpec → key in Values |
|---|---|---|
| Person | 1 |
Person |
| Reader | 2 |
Reader |
| Controller | 3 |
Controller |
| Access level | 4 |
Access Level |
Form edits are silent unless you turn on events. By default, a change to
Metadatadoes not create an Object Modified event. To change that, setShouldPublishUpdateEventstotrueon the form’s GenericInfo. It sits at the top level, next toTypeName. The UI copies this setting onto everyMetadataentry the form writes. If you leave itfalse, other systems will never see form edits through Change Tracking.
To list all forms, call GET {base}/api/f/{folder}/generics?typeName=CustomForm and then the same with typeName=CustomFormSpec. Keep the ones for the object type you care about.
Each form writes one entry in the object’s Metadata array. To find the right entry, match Application to the form’s ApplicationName.
Inside Values, each field key is the field label with the spaces removed and each word starting with a capital letter. So Employee Number becomes EmployeeNumber. When a user leaves a field empty, the UI stores the string "null".
"Metadata": [
{
"Application": "HR Info",
"ShouldPublishUpdateEvents": true,
"Values": "{ \"EmployeeNumber\" : \"10422\", \"FirstAidTrained\" : true, \"Shift\" : \"Day\" }"
}
]
Three things to know when you work with real data:
Metadata[].Values is a JSON string. Parse it to get the fields. When you write, send a normal JSON object instead.Metadata[].ShouldPublishUpdateEvents is a copy of the form’s setting. When you write through meta2, adding publishUpdateEvents=true to the request does the same thing for that one write.Metadata entry under its own Application name. Keep your own data there, not inside a form’s entry.| Operation | Request |
|---|---|
| List form definitions | GET /api/f/{folder}/generics?typeName=CustomForm and …=CustomFormSpec |
| Read / create / update / delete a definition | GET / POST /api/f/{folder}/generics, PUT / DELETE {form.Href} |
| Read values on an object | GET {object.Href} → Metadata[] where Application == ApplicationName |
| Write values on an object | PUT {object.Href}/meta2/{ApplicationName}?publishUpdateEvents=true with body { "EmployeeNumber": "10422", … } |
| Remove values on an object | DELETE {object.Href}/meta/{ApplicationName} |
A write replaces all of Values for that Application, so send every field, not just the one that changed. Adding publishUpdateEvents=true makes the write create an Object Modified event, so other systems can see it (see Change Tracking).
meta2 write with publishUpdateEvents=true creates an Object Modified event, and its AfterData already holds the new Metadata entryMetadata, in one go