Add forms to UI Builder pages
Summarize
Summary of Add Forms to UI Builder Pages
The Form component allows users to add one or more forms to UI Builder pages, enhancing the functionality by enabling data collection through defined fields. Users can add multiple forms to a single page, including forms within nested components or modals. This feature is particularly useful for extending record pages and improving user interaction.
Show less
Key Features
- Ability to create and manage multiple forms on a single UI Builder page.
- Field definition and property customization, including making fields required.
- Support for inline tabs and modals with forms on record pages.
- Prerequisite of applying a form controller preset for pages with forms from previous releases to ensure proper functionality.
- Single mapped form controller for managing global events on the page.
Key Outcomes
By following the setup instructions, ServiceNow customers can effectively add and configure forms on their UI Builder pages, enhancing data collection and user engagement. Ensuring that exactly one form controller is mapped to the app shell facilitates seamless event handling, improving the overall user experience on their applications.
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.
- 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.
- 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.
- 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.
- Output:
CTRL_RECORD#UPDATE_CONFIGURATION_MENU_REQUEST
- Phone Requested
-
- Description: Action to make a call when the CTI plugin is enabled.
- Output:
CTRL_RECORD#PHONE_REQUESTED
- Form Loading State Changed
-
- Description: Action to show a loading spinning when that form is loading data.
- Output:
CTRL_RECORD#FORM_LOADING_STATE_CHANGED
For detailed information about the Form component and its properties, see Form Overview on the ServiceNow Developer Site.