Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Flow designer for a variable set multiple choice

User_267
Tera Contributor

There is a variable set , in which it has multiple choice 

Please select

A ,B

If 'A'option is selected it needs to create a catalog task for particular group(ex: 1234)

And if 'B' option is selected it needs to create a catalog task for particular group(ex: 6789)

How to add variables in flow variables as these are part of variable set, and how add these steps in flow designer.

If I am using for each item action in flow, then whatever option a or b then it is creating catalog task for a option. How can I resolve this? It needs to go for individual groups

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@User_267 

in the catalog task flow action you can use inline script and access variable value and then set group value

var variableValue = fd_data.trigger.request_item.variables.<variableName>; // give here the variable name

if(variableValue == 'A')
	return 'group1SysId';
else if(variableValue == 'B')
	return 'group2SysId';

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

Without scripting can't I do in flow designer by using for each item action.

@User_267 

you can using multiple IF else actions, but why to increase the number of flow steps when it can be simply done using flow's capability of inline scripting

I would recommend using that

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