- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 09:12 AM
hi there. could you please guide me about it a bit? I am totally new to ServiceNow. Is there any tutorial for it about where to place this code or you could guide by referring to an example? Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 09:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 04:10 PM
Check the "Advanced" checkbox.
The body of the script can be generated using REST Message.
- From the Navigator, go to "System Web Services" > " Outbound" > "REST Message".
- Create a new REST Message by clicking on the "New" button.
- Fill in the Endpoint (i.e. enter the URI of the external url. e.g. http://xxx.aaa.com:8080)
- Select "Authenentication type" from pull down
- If there is a HTTP Request header, select the "HTTP Request" tab and insert the required headers.
- Select the "New" button next to the HTTP Methods
- Enter the "Name" and the "HTTP method".
- To test the uri and if there is argument to be passed in the uri, click on the "New" button next to the "Variable Substitution". For example, to replace "id" with some value such as "abc"
- Click the "Test" link under "Related Links" to test the endpoint.
- If all goes well, click on the "Preview Script Usage" link under the "Related Links". This will generate JavaScript code template.
- Paste the generated source code to business rule.
- If using MID Server, edit the source code as needed.
To parse JSON response,
var responseBody = response.getBody();
var response= JSON.parse(responseBody);
for(i=0;i<response.length;i++) {
// process json object
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 06:10 AM
How we call restmsg into BR . In therotical word how we ans this. How we can call restmsg into BR?
Please advise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 09:40 AM
Hi,
No those fields will not be available on any table. I took as example.
If you want to send the JSON then you need to create those output_payload(contains the json) and input payload (will get the response and captures here).
Example: If you need to send the a,b,c fields to x system. Then you can define the JSON and capture on field output_payload. so that we use that field on business rule to send data.
If you need more experience on integrations then refer below video and other which are available on youtube.
https://youtu.be/PC-h8U3Wuso
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar