Create custom controllers (Advanced feature)
Build custom controllers to use across experiences. Easily connect reusable data, scripts, and events to your page and set up inputs, outputs, and events.
Before you begin
Role required: ui_builder_admin
Procedure
- Navigate to All > Now Experience Framework > UI Builder.
- Select Create.
- Select Controller.
-
On the form, fill in the fields.
Table 1. Create a page collection form Field Description Name Name to track your controller internally. Description Short description to help find your controller. Write a description that helps page builders understand what content is included in the controller. -
Select Create.
The controller building window opens.
-
Add data resources.
- Select + Add data resource.
- Select a data resource from the list.
- Select Add.
- Configure the data resource.
- Select Save.
- Optional:
Add an external controller dependencies.
- Select + Add external controller dependency.
-
On the form, fill in the fields.
Table 2. Edit external controller dependency Field Description Name Name to identify your external controller dependency. Label Label to help find your external controller dependency. Controller Select a controller for your external controller dependency. - Select Save.
- Optional:
Add client state parameters.
- Select Client sate parameters.
- Select + Add.
- Enter a unique name for the client state parameter.
- Select the type from the dropdown.
- Enter an initial value in the field.
- Select Save.
For more information about client state parameters, see Client state parameters. - Optional:
Add client scripts.
- Select the + icon next to Client scripts.
- Write your script to perform an action.
- Optional:
Add a Script include or Associated components, which shows up in the
importsparameter of your client script function. - Select Apply.
- Select Save.
What to do next
Use the custom controller you just created by adding the controller to a page.