Custom Forms

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:

  • Where is the form itself stored?
  • When a user fills in the form, where do the values go?

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.

How it fits together

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:

  1. Loads all forms for Person.
  2. Draws the fields on screen.
  3. Reads and writes the values in that Person’s Metadata array.

One object type can have many forms. Each form keeps its values in its own Metadata entry.

graph LR G[("Generic
form definition")] --> Q["Forms for
Person"] U["User opens
a Person"] --> Q Q --> R["Render and
save"] R --> P[("Person
Metadata entry")]

The form definition

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 Metadata does not create an Object Modified event. To change that, set ShouldPublishUpdateEvents to true on the form’s GenericInfo. It sits at the top level, next to TypeName. The UI copies this setting onto every Metadata entry the form writes. If you leave it false, 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.

Where the values live

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:

  • In responses, 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.
  • Your integration can keep its own Metadata entry under its own Application name. Keep your own data there, not inside a form’s entry.

API calls

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).


  • Change Tracking - How to see when form values (or anything else) changed. A meta2 write with publishUpdateEvents=true creates an Object Modified event, and its AfterData already holds the new Metadata entry
  • Search Stream - Read many objects, with their Metadata, in one go
  • GenericInfo / PersonInfo - The object types involved