Form
The Form widget is a container that loads another Form (screen) named by formId and embeds it in place.
Use it to nest a reusable Form inside a screen and to connect message communication between parent and child Forms.
Definition and role
The Form widget loads the Form named by formId and renders it in the container area. The embedded Form has its own context, so the parent never reaches its widgets directly — the two communicate only through messages. From a script, load a different Form (loadForm) or send a message to the embedded Form (postMessage).
- Category: Contents
- Default
formId:""(created with no Form to load) - When the Form isn't found, a
form not foundmessage appears; while it loads, a loading indicator appears.
Features
| Feature | Description |
|---|---|
| Load a Form | Loads the Form named by formId and renders it inside the container. |
| Swap Forms | Replaces the embedded Form with another one using loadForm in a script. |
| Pass messages | Sends data to the embedded Form's message handler with postMessage in a script. |
| Loading and empty states | Shows a loading indicator while the Form loads, and a message when the Form isn't found. |
| Analytics events | Sets whether the embedded Form sends a screen view analytics event. |
How to use
- Open the Contents category in the left widget palette.
- Drag and drop the Form item onto the canvas.
- In the Properties panel on the right, enter the ID (path) of the Form to load in
formId. - To exchange data with the embedded Form, connect
postMessagein a script as needed.
Properties
| Property | Description | Default | Value / Type |
|---|---|---|---|
formId | ID (path) of the Form to load into the container | "" (not set) | String |
analyticsView | Whether the embedded Form sends a screen view analytics event | true (on) | True/false |
Notes and tips
When formId is empty or points to a Form that doesn't exist, the container shows only the form not found message. Specify the exact ID of the Form to load.
The embedded Form has its own context, so the parent can't reach its widgets directly. Pass data with postMessage, and swap in another Form with loadForm.
Learn more
For the full set of Widget Controls (Property, Method, and Event) that script this widget, see Form Widget Control.