Flow designer

Asmita7
Tera Expert

Hello Team,

 

I got this requirement for practise. 

 

Using create a flow field whenever a  is created.

 

 

 

 

Your suggestions will be appreciated.

Thank you very much,

Asmita

 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Asmita7 

in the script do this

var arr = [];
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group.name", "Security Incident");
gr.query();
while (gr.next()) {
    arr.push(gr.user.getDisplayValue());
}
return arr.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Sanjay191
Tera Sage

Hello @Asmita7 
Just User below line of code and flow logic .For  create a flow variable as string and store the active user  from  group that string  see  the below screenshots and let me know if anything else

Please refer the below screenshots and make the changes according to your requirement 

Sanjay191_1-1737102142698.png

 



Sanjay191_0-1737102122304.png

 

 Script Logic should be like below 

var grMember = new GlideRecord('sys_user_grmember');
grMember.addQuery('group',fd_data.trigger.current.assignment_group.toString());// you can also hardcode the sys_id or name of the group instead of i'm taking dynamic from the assignment group of the records
grMember.addQuery('user.active','true')//it give active users
grMember.query();
while(grMember.next()){
   activeUser = activeUser + ","+ grMember.getDisplayValue('user');
}
return activeUser

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You


View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Asmita7 

in the script do this

var arr = [];
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group.name", "Security Incident");
gr.query();
while (gr.next()) {
    arr.push(gr.user.getDisplayValue());
}
return arr.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank you @Ankur Bawiskar  for the prompt reply. It really helped to clear my doubt.

Sanjay191
Tera Sage

Hello @Asmita7 
Just User below line of code and flow logic .For  create a flow variable as string and store the active user  from  group that string  see  the below screenshots and let me know if anything else

Please refer the below screenshots and make the changes according to your requirement 

Sanjay191_1-1737102142698.png

 



Sanjay191_0-1737102122304.png

 

 Script Logic should be like below 

var grMember = new GlideRecord('sys_user_grmember');
grMember.addQuery('group',fd_data.trigger.current.assignment_group.toString());// you can also hardcode the sys_id or name of the group instead of i'm taking dynamic from the assignment group of the records
grMember.addQuery('user.active','true')//it give active users
grMember.query();
while(grMember.next()){
   activeUser = activeUser + ","+ grMember.getDisplayValue('user');
}
return activeUser

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You