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.

How to send notification based on the catalog form group variable.

raj99918
Tera Contributor

Hi ,

 

I need to send notification dynamically based on the  2 Group name variables(Group1 and Group2) from the catalog form. Who will receieve should be dynamic based on the those 2 groups from the form. How can I acheive this ?

 

5 REPLIES 5

Community Alums
Not applicable

@raj99918 ,

 

- Create a event using "Event Registry".

- In notification add that event under "When to send"

Sai149_0-1716490308339.png

- Check "Event parm 1 contains recipient"

Sai149_1-1716490398079.png

- In flow

 

Sai149_3-1716492197167.png

var emails =[];
var gr = new GlideRecord("sys_user_grmember");
gr.addEncodedQuery("group="+fd_data.trigger.request_item.variables.group_1+"^ORgroup="+fd_data.trigger.request_item.variables.group_2);
gr.query();
while(gr.next())
{
    
    emails.push(gr.user.email);
}

replace group_1 & group_2 with your actual variable names.

 

Please check & If my answer helped you in any way, please mark it as helpful or correct.