UI Builder- External API Calls

Hasan6
ServiceNow Employee
ServiceNow Employee

Hi Community,

 

I had a question on the UI Builder.

I want to make an on demand Rest API call to an external server for my use case.

 

The inbuilt solutions, data broker or helpers.snhttp, all require the call to first go to the instance backend, then from there to the external server. The external server sends the response to the instance backend, then only does it come to my browser.

 

Can I cut the middleman(instance backend) and directly configure UI Builder to make the api call to the external server?

 

Thanks

 

 

2 REPLIES 2

SrikanthReddy60
ServiceNow Employee
ServiceNow Employee

Hi @Hasan6 , 

Yes,  We can achieve this requirement in two ways.

1. user normal javascript fetch method, where you can call external server API directly from client script.

2. There is a new feature called "External REST Data Broker", which is available from the Washington release.
Table: "sys_ux_data_broker_rest_external"

With this, you can configure your API endpoint and call it from the UI builder. Without current instance/glide layer involvement, API requests will be made to the target system.

 

Hasan6
ServiceNow Employee
ServiceNow Employee

Hi Srikanth,

Quick follow ups:

1. Can you share a sample script for to implement in point 1?

2. I cannot seem to pass the http headers here:

Eg: Content-Type: application/json

How would I add that?

Hasan6_0-1730296248078.png

 

Thanks for looking into this.