Single Data Source for Multiple Visualizations

PradeepReddyA
Tera Expert

Single Data Source for Multiple Visualizations

 

Ever wondered if a single data source can dynamically power multiple visualizations like pie charts and bar charts. This is useful when multiple visualizations having same condition and we can also use this to make more dynamic.
In ServiceNow, this is possible using the Data Visualization API for Table Data Source in UI Builder.

 

Use Case

 

Consider a scenario where:

  • You have a Caller field on a page
  • You display associated incidents for that caller

 

 When the user changes the caller, the dashboard should automatically update.

 

 Example:
If the user changes the caller in search, the data visualization below should dynamically refresh based on the selected user.

 

Steps to Implement

   

    1. Open UI Builder
Navigate to UI Builder and open the page where you want to create the visualization.

 

    2. Select the Page
Open or create a page where you want to display dynamic visualizations.

     

    3.    Add Data Resource

  • Go to Data Resources
  • Search for Data Visualization API for Table Data Source
  • Add it to your page

 

PradeepReddyA_0-1775108827503.png

 

 

   

PradeepReddyA_1-1775108827516.png

 

    4.    Configure Dynamic Data

 

  • Use data binding to pass values dynamically (e.g., Caller)
  • Ensure the visualization updates when the input value changes and in this case we are giving static data and we can pass the dynamically

 

PradeepReddyA_2-1775108827529.png

 

      5. Set Aggregation & Grouping

  • Configure Group By (e.g., State, Priority)
  • Use Trend By if needed based on your requirement

     6. Bind Data to Visualization

  • Add a visualization component and in the data section click on the define data manually check box.
  • Bind it to the data resource using data binding in the data section

PradeepReddyA_3-1775108827542.png

 

PradeepReddyA_4-1775108827546.png

 

PradeepReddyA_5-1775108827559.png

     7. Switch Visualization Types Easily and Use the same data resource

  • Switch between:
    • Pie chart
    • Bar chart and more

 

PradeepReddyA_6-1775108827563.png

 

No need to recreate or reconfigure data

 

 

 

PradeepReddyA_7-1775108827565.png

 

8.We are using the same data resource for the horizontal bar as well and filter component is same component which we use in the Platform analytics.

 

PradeepReddyA_8-1775108827567.png

 

 

 

Key Advantage

 

A single data resource can be reused across multiple visualizations.
No need to configure separate data sources for each chart.
Dynamic data updates based on user interaction.

0 REPLIES 0