How to use GlideRemoteGlideRecord in a scoped application ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2020 04:47 AM
We tried to run the following script in our instance. It is working fine in Global Scope but showing an error in a scoped application. Error is attached as an image.
var remote_instance = "https://dev70329.service-now.com/nav_to.do?uri=%2Fhome.do%3F";
var table_name = "incident";
var r = new GlideRemoteGlideRecord(remote_instance, table_name);
// Set up the authentication
var username = "admin";
var password = "*****";
r.setBasicAuth(username, password);
// Perform the query
r.addQuery("number", "INC0009009");
r.query();
while( r.next() ){
gs.print("Short Description: " + r.getValue("short_description") + " (P): " + r.getValue("priority"));
}
- Labels:
-
Scoped App Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2020 11:59 AM
Hi,
GlideRemoteGlideRecord is not available in scoped application. Alternatively you can leverage Servicenow REST Table API's to interact with remote instance. You can Create, get, update and delete record on remote instance.
Ref - https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/c_TableAPI
I hope this helps!
Thanks & Regards,
Sharjeel
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2020 01:18 PM
Hi,
Unfortunately you cannot use GlideRemoteGlideRecord in scoped application, which was so nice to have.
You have to use REST API GET method to fetch the data when using scoped applications. Check out REST API Explorer (in your left navigation) for sample code.
Mark the comment as a correct answer and helpful if it answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2020 02:21 PM
I never even knew this existed, but then again, I wouldn't use anything that used Basic Auth between instances. I have setup a similar concept with a generic e-bonding set of scripts that uses OAuth between the instances. It detects what fields are updated, the type of the field and can send Comments, Work Notes and Attachments, as well as all other field types that are simple to send. I might be persuaded to share for a good bottle of Irish Whiskey. 🙂
Tapadh leat,
Aoife