Use the Form component to add one or more forms to UI Builder pages.
Add functionality to your UI Builder pages by including forms. You define the fields on the form and their properties, such as making them required. Then, collect data as the form is completed and submitted.Figure 1. Form component example
You can add more than one form to a single page. You can also add a form to a page that already contains a component with a nested form. Sample use cases include:
Extend record pages by adding an inline tab with a form using its own form controller instance.
Add modals with a form on a record page.
For existing pages with forms created in a pre-Xanadu ServiceNow release, you must apply a preset to the original form before adding another form to the page. Applying the preset is a prerequisite to adding multiple forms to a page and enables multiple forms to
work as expected on a page. The form controller preset should be applied onto all form controllers.
Open the page containing an existing form.
In the data drawer, expand the Data resources list and select the original form controller.
Select the Preset field.
Select Form controller preset.
Select Apply.
Select the X to close the Edit Form Controller pop-up.
Exactly one of your form controllers should have the Is mapped to app Shell property set to true. This
property is used to specify the primary form on the page. The primary form is responsible for handling global events. You shouldn't set the property to true for more than one form controller or have zero form controllers with
the property set to true.
Open the page containing one or more forms.
In the content tree, select a form.
In the configuration panel, on the Configure tab, select Form Controller.
On the Edit Form Controller pop-up, scroll down in the Form Controller list to find the Is mapped to App Shell option.
Select or clear the option for each form component on the page to confirm that exactly one form controller is mapped to the app shell.
Advanced form event handling
Experienced developers with knowledge of conflict event handling may find the following details useful.
If isMapped to app shell is set to true, the form handles these events automatically:
Screen Status Changed
Description: Action to indicate that a form is dirty.
Output: CTRL_RECORD#SCREEN_STATUS_CHANGED
Update Configuration Menu Requested
Description: Action to set record configuration menu items on the avatar menu.