How to bind data as source in Data Visualization component in Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 01:13 AM
Hi,
I am trying to create a dynamic report in Service Operation Workspace where I can change the data visualization query from a dropdown.
I don't understand how to build the data source. I have tried creating a JSON object but have no idea what parameters should be included. Tried a JSON string like this but that did not work:
{
"table": "incident",
"title": "Incidents assigned to you",
"query": "active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORDERBYDESC$AGGREGATE$^ORDERBYDESCsys_updated_on"
}
Here is the component setting in UI Builder:
Does someone here know how to do this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 01:22 AM
Hi @Per5 ,
Please refer to the KB:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1156652
Basically creating a Data Resource(glideRecord Query) and then creating a page script (Dynamic filter).
Once these are completed and associated to each other, you can go to the data visualization and add an event handler.
You'll see the page script that you created. Add it and save. The results wont translate on the builder page but testing it in workspace will show the filter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 02:13 AM
Thanks for the quick answer.
I am doing the same steps in the KB but it's missing lots of steps.
It looks like the data visualization uses incident as a static data source.
Where is the state parameter "encodedQueries" used?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 06:54 AM
Hi @Per5,
If you want to dynamically bind the data or update the filters in a data visualization, you can use the scripting.
I have answered a query for single score value. similar way you can configure for the other types as well.
Solved: Re: UI Builder Single Score make filter with bind ... - Page 2 - ServiceNow Community
Check out for time series: Dynamic Data Binding for TimeSeries Data Visualiza... - ServiceNow Community
If it was helpful, hit a thumbs up and mark as Correct.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 07:55 AM
Thanks, this looks like a solution.
I will test it tomorrow.