
- 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:31 AM
Hi,
Please note that you should replace gs.log with gs.info if the flow is created in a scoped app.
- Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2020 12:38 PM
Hi Pradeep,
I have tried that also but it didn't work either. I don't think the problem is related to that. When I am trying the same thing in my personal instance it is working fine. The logs are also coming. Also the the auto completion is working in my PDI which is not working in our company instance. Below is the screenshot from my PDI
What can be the cause of this issue?
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2020 02:12 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2020 09:41 PM
Hi Dirk,
Yes my flow was triggered and created the hr_case record. Values of all other fields were set properly except the one which I was trying using inline script option.
The surprising thing is that the same script is working properly in my personal instance.
Thanks.