UI Builder - Setting up dynamic filters on a data visualization using mergePARFiltersSummarySetting up dynamic filters on a data visualization by passing dynamic values using mergePARFilters parFilters state can be used to pass dynamic filters in UI Builder. The following is an example that explains how to apply dynamic filters using mergePARFilters in UI builder client scripting. Create an empty page with required parameters: table & sysId.In this example, we will configure a page to populate incident details such as incident number as header, short description and incident description but the focus will be on the data visualization on which dynamic filters are being set up.Configure a data visualization component - donut Dynamically pass filter conditions from page properties(table name)Include one more filter on incident 'caller' field by passing the 'caller_id' value dynamically from GlideQuery Record. To pass dynamic values to the data visualization filter, Select the data visualization component Create a page scriptAdd a script include: mergePARFiltersUse the below script: function handler({api, event, helpers, imports}) { const caller = JSON.parse(JSON.stringify(api.data.gliderecord_query_1.output.data.GlideRecord_Query.incident._results[0].caller_id.value)); //Reference from data resource: GlideRecord Query const mergePARFiltersV2 = imports["global.mergePARFilters"]().v2; api.setState("parFilters", ({ currentValue, api }) => { const customFilter = [ { type: "query", apply_to: [api.context.props.table], //Access page property value encoded_query: "caller_id="+caller }, ]; const { parFilters, encodedQueries } = mergePARFiltersV2( currentValue, customFilter ); api.setState("encodedQueries", encodedQueries); console.log(parFilters); return parFilters; }); } Coloured code snippet is the syntax to refer dynamic values accessed from 'GlideQuery Record' data resource & a page property. Below is the screenshot of configuration of data resource - GlideRecord Query. Below is the screenshot of the data resource GlideRecord Query to which the created TestDynamicFilter script has been added as an event handler so that the script gets access to the GlideQuery Record response & also triggered when the query fetches the data. Here is the visualization without dynamic filters being applied. In this example, Number of records on donut is populated as 91 as no conditions are hard-coded on the visualization datasource. Here is the final page where the visualization has been built on dynamic filters using mergePARFilters and results are refined. ReleaseAll versions