Bind an event to a declarative action
Bind data elements within UI Builder so that you can add event actions to a declarative action.
시작하기 전에
Role required: ui_builder_admin
이 태스크 정보
Bind a handled event to a component so that an action is performed when a user selects the component.
프로시저
- Navigate to All > Now Experience Framework > UI Builder.
-
Open an experience to work in or create an experience by selecting Create > Experience.
For more information, see Configure how users interact with your applications in UI Builder.
-
Open or create a page.
For more information about how to create a page in UI Builder, see Create a page in UI Builder.
-
Add a component to your page that can have a declarative action, such as an
action bar or related list.
For more information, see Add and configure components.
-
To create a declarative action definition in a table in the ServiceNow AI Platform®, navigate to Workspace Experience > Actions & Components > List actions.
Choose a table where you want the declarative action to be available in. For example, you could create a Complete my work action in an incident table or you could use an existing declarative action definition record.
그림 1. Platform declarative action definition record - Select the Active check box, and then save or update the record.
- Return to the UI Builder.
-
To invoke a handled event for the declarative action, go to the Configure panel and click Configure declarative action event mapping.
-
Choose the declarative action that you created earlier.
To continue with the example in step 5, the declarative action could be something like Complete my work.
-
To define what the declarative action does on your page, click + Add
event handler.
-
Give the event handler a name.
The name should describe what action you want the event handler to perform.
- 옵션: Provide a description of the event handler.
- Choose the handled event that you want to invoke.
- 옵션: Add payload values for your event handler.
- Select Save.
-
Give the event handler a name.
- Select Done.
-
Select Save, and then select
.
-
Test the declarative action on your page by clicking Complete my
work to see if it works.