
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2020 09:55 AM
I am trying to use the Inline Script in Flow Designer. I am trying to create an hr_case record with Create Record action and set the value of its Category field with inline script. Below is the screenshot and the code
/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
gs.log('flow');
var v = fd_data.trigger.inbound_email.direct.toString();
if (v == 'satt@gmail.com') {
gs.info('flow script');
var gr = new GlideRecord('hr_category');
gr.addQuery('name', 'XYZ');
gr.addQuery('active', true);
gr.query();
gs.info('gr val: ' + gr.hasNext());
if (gr.next()) {
return gr.sys_id;
}
}
It is not even executing the first line "gs.log('flow')" as I can not see that in the logs. Please let me know what I am doing wrong.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 05:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2020 07:15 AM
When I test the Flow by clicking the 'Test' button in top of the Flow Designer page it is working fine. But when the Flow is triggered when a mail is received (we are using Inbound Email trigger in the flow) it is not working.
I think my Flow is correct as it is working fine when I test it by clicking 'Test' button, something else we are missing. I have created a case in HI portal. They are investigating this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2020 07:28 AM
According to the community post: https://community.servicenow.com/community?id=community_question&sys_id=3e1c6b4bdb5544d8414eeeb5ca9619c2 It is related to PRB1361893.
Need to check if it is fixed in NY Patch 7.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 05:36 AM
It is fixed in NY Patch 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2020 09:47 AM
Hi
Maybe it is a quite "simple!" thing, that your are facing.
When capturing a Script in that way, DO NOT click the "FX" button to close the script.
If you click "FX" then it will disappear and NOT been executed.
Instead use the arrow up button right to the "FX" button to "hide" the script.
This is important to know.
Maybe this is the only reason, why your script will not fire.
Let me know if that solved your issue and mark my answer as correct/helpful.
Have fun & BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 03:45 AM
Hi
Did my answer solve your problem, or does it still exist?
If it solved, please mark my answer as correct.
Have fun
BR
Dirk