How to pass reference field from UI action to subflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 11:02 PM
I need to pass a reference field of sys_user_group table to my subflow. So for that I have tried using :-
var inputs = {};
var group = current.group; (group is a reference field for sys_user_group table.)
inputs['group'] = group;
sn_fd.FlowAPI.executeSubflow('x_797879_l_d_relea.create_product_and_release', inputs);
But it shows me this exception :- com.snc.process_flow.exception.ProcessAutomationException: Invalid GlideRecord input format found
I have also tried with sys_id i.e.
var group = current.group.sys_id;
but still it shows same exception.
Can anyone help please ?
- Labels:
-
Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 11:08 PM
Hi,
did you try passing hard-coded sysId
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 11:12 PM
Hi Shubham,
Sometime we are facing the issue with references try the below code it may help you
var inputs = {};
var group = current.getValue(group); (group is a reference field for sys_user_group table.)
inputs['group'] = group;
sn_fd.FlowAPI.executeSubflow('x_797879_l_d_relea.create_product_and_release', inputs);
Thanks
Chandu Telu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 07:27 AM
Hi,
If you need to pass a reference to a GlideRecord object as input to a Flow, a SysID will not work, because it is a string.
So change your code to something like this:
var inputs = {};
var groupID = current.group; // get the sysID of the group
var groupGR = new GlideRecord('sys_user_group');
groupGR.get(groupID); // get the reference, the group record
inputs['group'] = groupGR;