The CreatorCon Call for Content is officially open! Get started here.

How can we automate adding the Catalog Item variable user to the requested Azure resource group?

VIKASM535239375
Kilo Sage

How can we automate adding the Catalog Item variable user to the requested Azure resource group?

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@VIKASM535239375 

please explain your requirement with screenshots

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

Robert H
Mega Sage

Hello @VIKASM535239375 ,

 

What is the "Azure resource group"? Is it a group in ServiceNow? In that case you would just need to create a new Group Member record in the Flow or Workflow.

 

As a script it would look like this:

var gr = new GlideRecord('sys_user_grmember');
gr.initialize();
gr.user = current.variables.NAME_OF_VARIABLE_THAT_CONTAINS_THE USER;
gr.group = current.variables.NAME_OF_VARIABLE_THAT_CONTAINS_THE GROUP;
gr.insert();

 

Regards,

Robert

Shree_G
Mega Sage
Mega Sage

Hello @VIKASM535239375 ,

 

Assuming you are using flow to support the Service Catalog. You can achieve the case as below :

 

1. Get the catalog variables :

Shree_G_0-1745561971086.png

 

2. Using the Azure AD spoke action to add user to the group, utilize the variables collected to add to the group.

3. If "Azure resource" is a Group, create a record in the "sys_user_grmember" group.

Shree_G_0-1745563791512.png

 

 

 

 

 


If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.