- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:26 PM
Hi Team,
I am trying to fetch the record and I want it dynamically, so whenever I am selecting the record in instance 2, I want all the data of that record from instance 1.
I am using rest message for this and in get method I am trying to fetch the single record.
I am able to fetch all the records but I want single record only.
any changes I need to do in script?
I am able to pass the query parameters but not able to see them in the script?
try { var r = new sn_ws.RESTMessageV2('PDI Int Get data', 'Default GET'); //override authentication profile //authentication type ='basic'/ 'oauth2' //r.setAuthenticationProfile(authentication type, profile name); //set a MID server name if one wants to run the message on MID //r.setMIDServer('MY_MID_SERVER'); //if the message is configured to communicate through ECC queue, either //by setting a MID server or calling executeAsync, one needs to set skip_sensor //to true. Otherwise, one may get an intermittent error that the response body is null //r.setEccParameter('skip_sensor', true); var response = r.execute(); var responseBody = response.getBody(); var httpStatus = response.getStatusCode(); } catch(ex) { var message = ex.message; }
Can anyone help me in this?
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:39 PM
you need to use Retrieve records API and pass the query
Use this to get only 1 record
You will also get code sample on how to consume it. this will help you when you consume it from other instance
No need of REST Message in other instance, directly use the above script and give correct authentication details.
I believe this much information is sufficient for you to start and enhance it further
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:50 PM
To fetch single record from other instance, we have make our endpoint unique, make modification in REST Message with the GET method with following endpoint.
https://instance1.service-now.com/api/now/table/{table_name}/{sys_id}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:35 PM
Would you mind closing your earlier questions by marking appropriate response as correct?
Members have invested their time and efforts in helping you.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:39 PM
you need to use Retrieve records API and pass the query
Use this to get only 1 record
You will also get code sample on how to consume it. this will help you when you consume it from other instance
No need of REST Message in other instance, directly use the above script and give correct authentication details.
I believe this much information is sufficient for you to start and enhance it further
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 02:38 AM
Any update to my above comment?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:50 PM
To fetch single record from other instance, we have make our endpoint unique, make modification in REST Message with the GET method with following endpoint.
https://instance1.service-now.com/api/now/table/{table_name}/{sys_id}