
- 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-19-2020 10:03 PM
Just a silly idea:
WHat is the Release Version of your PDI, and which of your "other" instance (where the flow does not work properly)?
Is there a difference as well?
Let me know. please.
Thanks & BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 05:44 AM
Hi Dirk,
Both of them is New York (my PDI as well as our organization's DEV instance).
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 06:56 AM
Hi
Are both Flows within the same scope?
(in your Dev and PDI instances?)
BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 06:59 AM
Hi
Just one more short question:
Do you have the same plugIns on the DEV instance, like on your PDI.
You wrote aboute an "HR CASE", which may need some extra Plugins to be available in your instance.
If you exported and imported the flow, maybe some basic prerequisites (existing tables from PlugIns) are even missing.
Let me know, if that solves your issue.
BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 06:43 AM
Hi
Where exactly did you take this screenshot?
Can you supply a bit wider screenshot (full screen or dialog) where this editor is located. That may be different ones, but I would like to relay your example a bit closer.
Thanks a lot
Dirk