How to apply dynamic filters to data visualization component in UI builder?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2022 11:46 AM
Hello experts,
I am trying to apply dynamic filter to data visualization components like Donut/Pie charts in UI builder. We don't have dynamic data binding filter option in Data Sources selected on Data Visualization component. We can configure only static filters like 'Active=true' in data sources that are used in Pie charts/Donut reports.
I am trying to apply dynamic filter on Pie Chart created on Entity overview page of Risk workspace. I would like to show ALE data of a specific entity or current entity on Pie chart instead of showing ALE data of all entities. I have sys_id of current entity in context object:@context.props.sysId. Is there any way to use this sys_id in a data visualization component to show data of current entity?
I went through below article but I could not understand the way it is relating a filter component to Data Visualization component.
In multiple OOB pages reports, I see that ServiceNow is using 'Apply par filter' client script to filter such data visualization reports but I could not figure out the relationship between filter component and data visualization component.
Please let me know if you have implemented something similar in ServiceNow.
Thanks,
Abhinandan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2022 12:36 PM
If the data source component has an encoded query property, set that to a state parameter.
Update the state parameter via the change (or equivalent) event of the dynamic filter.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 07:31 AM
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 08:07 AM
I checked and it indeed works diffrent.
You must add a Dashboard Viewport Component
From there click Open Dashboard Builder
On that page, you should build the actual dashboard, and add the Filter and Data Visualisation components.
After saving, in the UI Builder page, assign the Dashboard Viewport Component to the new created dashboard.
Now with the default settings, your data visualisations should follow the filters.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 11:09 PM
Yes
But still I am unable to achieve my actual requirement. Requirement was to show specific field data of only current record/entity in Pie chart form. And as I mentioned I have the sys_id of the current record in context object:@context.props.sysId. There is no provision to use dynamic value even in dashboard builder filter. Is there any way to set the default value or only one dynamic value in a filter of a Dashboard?
Thanks for your time on this!