What is the sys_id gs.executeNow() is returning?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2022 12:13 PM
I have a code on a record producer that fires "gs.executeNow()" to trigger a scheduled data import. When I put "gs.addInforMessages(gs.executeNow())" I am getting a sys_id back, however, what is that sys_id? Is it the sys_id of "concurrent imports sets" or "import sets" because I can't find where that sys_id is located at?
Here is the sample code of gs.executeNow().
function fireTransformMap(){
var exportGr = new GlideRecord("scheduled_import_set");
exportGr.addQuery("sys_id", "fc2bcbf2db9a451077953b98f4961920");
exportGr.query();
if (exportGr.next()) {
gs.addInfoMessage(gs.executeNow(exportGr)); // this is for scoped app, trigger schedule import
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2022 12:32 PM
This post might help you to find the table name from where you are getting that sysid
https://community.servicenow.com/community?id=community_question&sys_id=bda11b6ddbdcdbc01dcaf3231f961949
Feel free to mark correct and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2022 12:33 PM
executeNow(GlideRecord job)
You can only use this method on a job in the same application as the script calling this method.
Name | Type | Description |
---|---|---|
job | GlideRecord | Job to run. |
Type | Description |
---|---|
String | Returns the sys_id of the scheduled job. Returns null if the job is global. |
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2022 12:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2022 01:33 PM
Hmm, that doesn't make any sense, though.
The scheduled job sys_id I am passing in is "fc2bcbf2db9a451077953b98f4961920," if that doc is to be believed then I should be getting "fc2bcbf2db9a451077953b98f4961920" back as a return but I am getting another sys_id "f60a3a1edb3f8d9036890825ca9619bb"