Set up multiple filters on UI builder for data visualization reports/charts

sshantam
Tera Contributor

Hi,

 

I would like to know a way to setup two individual filters that should be independent upon each other using UI builder to filter data visualization reports/charts data based on the user selection.

 

The challenge I am facing is whenever I am selecting one filter condition , automatically the other filter is getting affected as both the filter data payload is getting stored in variable named "appliedFilters".

 

I am trying to follow the same steps mentioned below for both the filters as mentioned in Interactive filter for data visualization 

 

  • Name script name as “apply filter”
  • Add the existing script include named “mergePARFilters”
  • Add below script in the script section

 

function applyFilter ({ api, event, imports }) { api.setState('parFilters', ({ currentValue }) => { const { payload: { appliedFilters } } = event; return imports['global.mergePARFilters']()(currentValue, appliedFilters); }); }

 

 

Can anyone please suggest what am I missing or doing wrong?

 

Any suggestion provided will be highly appreciated!

 

Cheers,

Shreyash

2 REPLIES 2

mikebeardsley
Tera Contributor

did you ever get this to work? I am having the same issue.

pavan_yakkala1
ServiceNow Employee
ServiceNow Employee

Hi,

 

Please let me know if this is working on Data Visualization - Time Series (Column)