Dynamically filtering lists via components in UI Builder

Cooper5
Tera Contributor

I am trying to filter a list via a dropdown menu selection and am unable to figure out how to connect the dropdowns events to refreshing the data resource, or the lists, w/a filter.  I know there is an option to filter the lists using the default filters from either the configuration window, or the user facing UI, but we have been asked to streamline this functionality.

Is using a dropdown component to update the filter possible?  If so, how?

Is there a better way to approach this scenario?

1 ACCEPTED SOLUTION

Just FYI, the ability to do data binding inside the filter like that was added in Rome, so if you're on Quebec this approach won't work for you. This blog post shows you one strategy for doing a dynamic filter on a Quebec instance: https://developer.servicenow.com/blog.do?p=/post/quebec-ui-builder-lists/

View solution in original post

17 REPLIES 17

anubhavkapoor76
ServiceNow Employee
ServiceNow Employee

Hi Cooper,

Bind the filter value through dynamic binding to the value of the drop down selected as below:

 

 

find_real_file.png

 

In below case i have populated Incident table in LIST and priority in drop down 

find_real_file.png

a) From drop down events "Dropdown item clicked" call the client script to update the newly created Client State Parameter as follows:

find_real_file.png

 

Client tate Parameter:

 

find_real_file.png

 

b) In the client script update the CSP from the drop down item value.

find_real_file.png

 

Mark this helpful/correct if it works for you.

Cheers,

Anu

Hi Anu, thank you for your response!  Where are you building that filter that you can data-bind the value like that?  On my list I dont have the ability to select a column to filter on and I also dont see it in the "filter" component.

When you select your 'LIST' component then on right pane you will see 'Edit Filter' as in screenshot below

find_real_file.png

On click on that edit filter option you will get the options to create your filter

find_real_file.png

 

Mark this helpful/correct if its works for you

Cheers!!

Anu

Just FYI, the ability to do data binding inside the filter like that was added in Rome, so if you're on Quebec this approach won't work for you. This blog post shows you one strategy for doing a dynamic filter on a Quebec instance: https://developer.servicenow.com/blog.do?p=/post/quebec-ui-builder-lists/