Filter records by priority with a flyout menu
Configure a flyout menu that filters a task record list based on priority selections.
始める前に
Role required: admin
This procedure uses UI Builder components to create dynamic, interactive layouts. For more information on how to configure components, see:
| Component | Documentation links |
|---|---|
| Flyout menu | |
| Record list |
手順
- Navigate to All > Now Experience Framework > UI Builder.
-
Open an experience to work in or create an experience by selecting Create > Experience.
See Configure how users interact with your applications in UI Builder for more information on creating experiences.
-
Create a page from scratch.
For more information about how to create a page, see Create a page in UI Builder.
- Select Add content on the stage or in the content tree to open the toolbox, then add a Record list component to the page.
-
In the Data and scripts panel, select the List Controller data resource that was auto-created with the Record list component.
- Set Table to Task.
- Set Record count limit to 25.
- Under Returned fields, add the fields you want to display in the list (for this example, add Number, Short description, Priority, and State).
- In the Data and scripts panel, select Client state parameters and then select Add.
-
Configure the client state parameter:
- Set Name to priorityFilter.
- Set Type to JSON.
- Set Initial value to ["1","2","3","4","5"] so all task records display on page load.
- Select the List Controller data resource again, then select Edit fixed filter.
-
Configure the filter condition:
-
Set the first field to
Priority. -
Set the operator to
is one of. -
Hover over the third field and select the bind data icon
.
-
In the data binding modal, select Client states, then double-click or drag the
priorityFilterpill to move it to the area above. - Select Apply to confirm the binding.
- Select Apply to save the condition.
-
Set the first field to
-
Add and configure a Flyout menu component.
-
In the content tree, hover over Record list and select the Configure icon
.
- Select Add before.
- Search for Flyout menu, select it from the toolbox and then select Add.
- In the configuration panel, hover over List items, then select Edit.
-
Set the Mode to JSON and replace the existing code with the following array:
[ {"id": "1", "label": "1 - Critical"}, {"id": "2", "label": "2 - High"}, {"id": "3", "label": "3 - Moderate"}, {"id": "4", "label": "4 - Low"}, {"id": "5", "label": "5 - Planning"} ] - Select Apply.
-
In the content tree, hover over Record list and select the Configure icon
- In the content tree, locate the trigger slot under Flyout menu and select Add content.
-
Add a button from the toolbox.
This button will open the flyout menu.
-
Configure the flyout menu to update the list and refresh the data resource when the user selects an item.
- In the configuration panel, select the Events tab.
- Under Flyout menu selected items set, select Add handler.
- Select the Set client state parameter handler, then select Continue.
-
Set the following properties:
Field Action Client State Parameter Name Select priorityFilter from the list. Value to use after triggering event - Hover over the field and select the bind data icon
.
- Select Data types, then Event payload.
- Under Pill view, double-click or drag the value pill to move it to the area above.
- Select Apply to confirm the binding.
- Select Add.
- Hover over the field and select the bind data icon
- In the Events tab in the configuration panel, select Add handler underneath the event we added in the previous step.
-
Locate Incident lookup (1), select the REFRESH handler, then select Continue.
- Select Add.
- Select Save.
-
Preview and test the page.