Developers
The form document
The JSON structure of a form, as exported, imported and passed to hooks.
A form export (Import and export) is a JSON object with format: "flavonto-forms", the export format version (1), the plugin version that made it, the form title and its doc. Hooks receive the same doc array.
{
"schemaVersion": 1,
"settings": { "title": "Contact us", "showTitle": true, "preset": "clear", "...": "..." },
"pages": [
{
"id": "p_main01",
"type": "page",
"title": "",
"children": [
{ "id": "f_name01", "type": "name", "name": "name", "label": "Your name", "required": true },
{
"id": "f_topic1",
"type": "radio",
"name": "topic",
"label": "What is it about?",
"options": [ { "label": "Sales", "value": "sales" }, { "label": "Support", "value": "support" } ]
},
{
"id": "f_order1",
"type": "text",
"name": "order",
"label": "Order number",
"logic": {
"action": "show",
"match": "all",
"groups": [ { "match": "all", "rules": [ { "field": "f_topic1", "op": "is", "value": "support" } ] } ]
}
},
{ "id": "f_send01", "type": "submit", "text": "Send" }
]
}
],
"notifications": [ { "id": "n_team0001", "name": "Team", "trigger": "submitted", "subject": "New: {field:name}", "...": "..." } ],
"confirmations": [ { "id": "c_thanks01", "type": "message", "message": "<p>Thank you.</p>", "...": "..." } ],
"integrations": [ { "id": "i_webhook1", "type": "webhook", "enabled": true, "config": { "...": "..." } } ],
"payment": { "enabled": false, "providers": [ "stripe" ], "amountSource": "fixed", "currency": "USD", "...": "..." }
}
Rules
- Ids are stable and unique in the document: a type letter, an underscore and lower case letters and digits (
f_fields,p_steps,s_sections,g_repeating groups,r_rows andc_columns; emails, confirmations and integrations usen_,c_andi_in their own lists). Logic, formulas and entries refer to ids. - Names (
name) are what merge tags ({field:topic}), formulas ({topic}), exports and integrations use. They are unique among fields and are made from the label when empty. - Containers:
page,section,row(whose children arecolumns),columnandrepeaterhavechildren. Fields inside arepeaterare answered once per row. - Choices have an
id, alabeland avalue(unique within the field); optionallycalc(number for calculations),capacity(places),default,imagewithimageAlt, andicon. - Settings of every field type, with their types and defaults, are listed in Field reference; form settings in Form settings.
Documents are sanitised when saved: unknown keys are dropped, HTML in rich text is limited to safe tags for people without the unfiltered_html capability, and the builder's Check lists anything that blocks publishing. Older documents are upgraded on load (flvf_upgrade_document).