- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 08:20 AM
Hi all!
I am trying to surface data from an external, public API (ex, https://datausa.io/api/data?drilldowns=Nation&measures=Population) on a Page within UI Builder.
I am new at SNOW❄️ but it seems possible to do it in UI Builder, by
1. Add "Data resource instance":
2. Add new "REST" Data resource:
3. Configure a GET request and specify the API URL under the "API" field:
4. Add it via UI Builder > "Data resource instances" > + Add > App > Data resource > "get datausa entries" > Add
BUT, I get a "Requested URI does not represent any resource" error message:
Kindly let me know if there is a different approach and where I could have gone wrong.
Many thanks!
❄️
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2023 06:23 AM
You can make a request to an external REST API from within UI Builder following these high-level steps:
1. Create a new REST Message record with a GET method configured for your REST API endpoint.
2. Create a new Transform Data Resource inside UI Builder
3. Before you use the Transform Data Resource you need to create an ACL for it (type: "ux_data_broker", operation: "execute", name: sys_id of the Transform Data Resource)
4. Invoke the REST Message from within the Script section of the Transform Data Resource.
I've explained this in more detail in the video below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 08:42 AM
I think that feature is for referring to REST APIs on the same ServiceNow instance and not remote resources.
If you look at the out of the box records on the "REST Data Broker" [sys_ux_data_broker_rest] table this seem to be the case with the OOB records.
Another way to do what you are trying to do would be to use a Data Stream and a Remote Table instead.
Then, call the Remote Table as a regular GlideRecord Query.
--------------------------------------------------
Workflow Cowboy
LinkedIn: https://www.linkedin.com/in/dalestubblefield/
YouTube: https://www.youtube.com/@starlordnow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 08:43 AM
Here is a similar Community post:
--------------------------------------------------
Workflow Cowboy
LinkedIn: https://www.linkedin.com/in/dalestubblefield/
YouTube: https://www.youtube.com/@starlordnow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 08:48 AM
Thanks for the reply.
The post you linked to is using an internal ServniceNow API (/api/now/...).
I am trying to send a request to an external, public API URL: https://datausa.io/api/data?drilldowns=Nation&measures=Population
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2023 06:23 AM
You can make a request to an external REST API from within UI Builder following these high-level steps:
1. Create a new REST Message record with a GET method configured for your REST API endpoint.
2. Create a new Transform Data Resource inside UI Builder
3. Before you use the Transform Data Resource you need to create an ACL for it (type: "ux_data_broker", operation: "execute", name: sys_id of the Transform Data Resource)
4. Invoke the REST Message from within the Script section of the Transform Data Resource.
I've explained this in more detail in the video below: