Skip to main content

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 found message appears; while it loads, a loading indicator appears.

Features

FeatureDescription
Load a FormLoads the Form named by formId and renders it inside the container.
Swap FormsReplaces the embedded Form with another one using loadForm in a script.
Pass messagesSends data to the embedded Form's message handler with postMessage in a script.
Loading and empty statesShows a loading indicator while the Form loads, and a message when the Form isn't found.
Analytics eventsSets whether the embedded Form sends a screen view analytics event.

How to use

  1. Open the Contents category in the left widget palette.
  2. Drag and drop the Form item onto the canvas.
  3. In the Properties panel on the right, enter the ID (path) of the Form to load in formId.
  4. To exchange data with the embedded Form, connect postMessage in a script as needed.

Properties

PropertyDescriptionDefaultValue / Type
formIdID (path) of the Form to load into the container"" (not set)String
analyticsViewWhether the embedded Form sends a screen view analytics eventtrue (on)True/false

Notes and tips

note

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.

tip

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

tip

For the full set of Widget Controls (Property, Method, and Event) that script this widget, see Form Widget Control.