How to use REST data broker in UI Builder to retrieve ServiceNow data

gjz
Mega Sage

I have read one of the most efficient ways to retrieve data in UI Builder or a Workspace is by using internal REST APIs to retrieve the data to display, however, I have not been able to find any examples I can follow or seen any documentation or posts on how to do this.  I've looked at some components built for CAB meetings in Service Operations Workspace that do use REST to get data, but a lot of it is hidden and I can't figure out how it is done.

 

Using a very simple example, how would I create a REST data broker in a workspace to retrieve data from the Incident table and display the data in a repeater?  Can anyone walk me through this?

2 REPLIES 2

Abhit
Tera Guru

@gjz 

You can achieve this by creating a Scripted REST API to fetch Incident records, then exposing it via a REST Data Resource (Data Broker) in UI Builder.
Bind the data broker output to a Repeater using @data.<resource>.output, and inside the repeater use @item.value.<field> to display values like number and description.
The key idea is: Data Broker fetches data → Repeater renders the array.
For simple use cases, you can also use “Lookup Multiple Records” instead of REST.

For more details you can refer to the below articles:

UI Builder: How to create and use a REST data brok... - ServiceNow Community
All About Data Resources in UI Builder - ServiceNow Community
How to use Repeaters in ServiceNow | by Debendu Das | Medium
Next Experience - UI Builder Basic Repeater Exampl... - ServiceNow Community

If this response helps, please mark it as Accept as Solution and Helpful.

~Ak

 

Tanushree Maiti
Tera Patron

Hi @gjz 

 

Refer following posts/video:

UI Builder: How to create and use a REST data broker

https://www.youtube.com/watch?v=3SgY8E6T7oA

https://www.servicenow.com/community/developer-forum/get-external-data-via-rest-data-broker/td-p/140...

 

https://www.servicenow.com/community/developer-forum/how-to-retrieve-data-with-a-script-include-in-u...

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti