Need to add user to two group

Abdul
Tera Contributor

Hi,

 

I have written a code for catalog item run script, when when a user selects two check boxes, one production and the other is UAT, then they should be added to two okta group. i have given the guid of the two groups in sys property.

When the user selects both the check boxes, only of the code gets executed and the user is getting added to just one OKTA group. How can we get this right? please help.

 

Abdul_3-1745304488898.png

Abdul_4-1745304543206.png

 

1 ACCEPTED SOLUTION

@Abdul 

you can pass multiple inputs to workflow when you invoke it

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

4 REPLIES 4

J Siva
Tera Sage

Hi @Abdul 

Use different scratchpad variables for PROD and UAT types. According to your current script, the user will only be added to the UAT groups because you are using the same workflow.scratchpad.group variable for both types, and it's getting overridden.

For prod use, workflow.scratchpad.group_prod

For UAT use, workflow.scratchpad.group_uat

Regards,
Siva

 

Regards,
Siva

 

Abdul
Tera Contributor

right now i am sending the output of this to another workflow, how can i do that if i am declaring two different variables?

@Abdul 

you can pass multiple inputs to workflow when you invoke it

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Abdul 

please share the complete script

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