Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

flow designer action output not showing in subflow

Madala Chaitany
Giga Guru

Hi,

I have created action in flow designer, When I tested Action in Output it's working but in subflow output is not triggering.

Attaching screenshot below check and help me out.

Subflow

find_real_file.png

Action

find_real_file.png

Action Script

(function execute(inputs, outputs) {
// ... code ...
  var grpMngrs = '';
  var grps = new GlideRecord("sys_user_group");
  grps.addEncodedQuery('sys_idIN' +inputs.groups_sysid);
  grps.query();
  while(grps.next()){
    gs.info("User Sys_id4 groups Sys_id" +inputs.groups_sysid);
    grpMngrs += grps.manager.sys_id + ',';
    gs.info("User Sys_id5 grpmngrs Sys_id" +grpMngrs);
  }
  outputs.group_parent = grpMngrs;
})(inputs, outputs);

 

Please Someone help me out.

Thanks & Regards,

Chaitanya

1 REPLY 1

Chinmay Tawade1
Tera Guru

So you are looking for groups manager by passing Group Sys ID.

For every group there is only one Manager. And hence it will return only one Manager Sys ID.

And I have seen you have used Outputs Type=List.

Instead,

Use Output Variables Type as Refrence(sys_user) as there will be only one User/Manager for a Group.

Hence you will be getting manager as a record and you can extract any info from it.

 

Img 1- Custom Action Script

find_real_file.png

 

Img 2 - Action Output

find_real_file.png

 

Img 3 - Actions O/P in Subflow

find_real_file.png

 

Alternative/Recommended way of doing this - 

As you have Sys ID of group.

Lookup to sys_user_group table using that sys id.

Hence you will have access to the groups manager.

In below img I have looked up Group record.

find_real_file.png

 

 Please Mark Helpful/Correct if this has solved your problem.

 

Thanks,

Chinmay T.