Choices and lists
Rows people add
A café has staff, and the form does not know how many. A list asks its own fields once per row, and people add rows as they go.
item names one row. The engine uses it mid-sentence, in Add staff member and Staff member 1, so write it in lowercase; a heading gets its capital on its own.
{
key: "staff",
type: "list",
label: "Staff",
item: "staff member",
fields: [
{ key: "name", type: "text", label: "Full name" },
{ key: "role", type: "text", label: "Role" },
],
},
Add the list to the section, fill in the first row, then add a second. Open the Payload tab: staff is a list with one object per row, [{ "name": "…", "role": "…" }, …].
A required list starts with one empty row, and every row must be complete. The fields inside a row are ordinary fields, so optional, when and the other options work there too.