ServiceNow Learning 29: "executeNow" function usage in scoped APP ServiceNow.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 08:44 AM
Hi All,
Very useful function "executeNow" in Scoped APP ServiceNow. Here is an example below:
Eg. 1 : Want to execute Scheduled Data Export conditionally from Flow Designer/Any other Server script
E.g. 2 : Want to execute Schedule Data Import conditionally from Flow Designer/Any other Server script
E.g. 3: Want to execute Script Actions or any script that has execute button.
var jobId = '61847fe04c603300fa9bb64c2b491dac';
var now_GR = new GlideRecord('sysauto_script');
if (!now_GR.get(jobId)) {
throw new Error('Unable to find import job');
}
gs.executeNow(now_GR);
This is very good feature to use it in any server side script.
Best part is it is supported in scoped app.
Hope this helps.
Regards,
Shamma
Regards,Shamma Negi
0 REPLIES 0