- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 10:20 AM
Hi Team,
Use Case:
output the data returned from following public api (no auth needed) in a flow designer action.
Any suggestions, how to achieve this?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 03:28 PM
Hi, hope you are well.
In Flow Designer you can have an action that does this.
Here is a script for your Flow Designer action that makes a call to the API https://catfact.ninja/fact, gets a fact about cats and sets the output to outputs.text:
(function execute(inputs, outputs) {
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://catfact.ninja/fact');
request.setHttpMethod('GET');
var response = request.execute();
var responseBody = response.getBody();
var responseJson = JSON.parse(responseBody);
outputs.text = responseJson.fact || 'Nenhum fato encontrado';
})(inputs, outputs);
Below I ran the code snippet in the background script to test the functionality:
If my answer helped you, let us know by marking it as correct and useful.
Thanks !
- Carlos Petrucio

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 03:28 PM
Hi, hope you are well.
In Flow Designer you can have an action that does this.
Here is a script for your Flow Designer action that makes a call to the API https://catfact.ninja/fact, gets a fact about cats and sets the output to outputs.text:
(function execute(inputs, outputs) {
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://catfact.ninja/fact');
request.setHttpMethod('GET');
var response = request.execute();
var responseBody = response.getBody();
var responseJson = JSON.parse(responseBody);
outputs.text = responseJson.fact || 'Nenhum fato encontrado';
})(inputs, outputs);
Below I ran the code snippet in the background script to test the functionality:
If my answer helped you, let us know by marking it as correct and useful.
Thanks !
- Carlos Petrucio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 07:13 PM
so what did you configure so far and what's not working?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader