How to bind data as source in Data Visualization component in Workspace

Per5
Giga Guru

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:

Per5_0-1682409913741.png

 

Does someone here know how to do this? 

4 REPLIES 4

Community Alums
Not applicable

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.

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?

Nootan Bhat
Kilo Sage

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

Thanks, this looks like a solution. 
I will test it tomorrow.