Using a MRVS variable as a Switch option in a workflow not progressing

Julie Dixon
Tera Expert

Hi, hope I can have some help with this one as now scratching my head.

 

I need to use a variable in an MRVS I have in a catalog item, to direct the workflow to create a task for one of two teams, dependent upon the choice made.  

 

JulieDixon_0-1750238428287.png

 

Despite my best efforts the Switch finishes and doesn't progress.  I've checked the condition, and these all match with the variable (it added the conditions automatically from the variable when I added the switch).

JulieDixon_1-1750238569717.pngJulieDixon_2-1750238652427.png

 

Here are the results of the workflow action

JulieDixon_3-1750238803889.png

 

Any help is appreciated.  Thank you in advance, Julie 

 

 

6 REPLIES 6

@Julie Dixon 

you can use workflow run script and parse and store env in workflow scratchpad variable

there are limitations when it comes to using Switch and since your variable is within MRVS, hence it doesn't work as expected

var jsonString = current.variables.mrvsVariableSetName;

var obj = JSON.parse(jsonString);
var env = obj[0].environmentVariableName;

workflow.scratchpad.env = env;

Then use IF activity to check the environment

also check this

switch case on workflow for lookup select box 

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, I will next try on Monday when back in the office and get back to you.  Many thanks for your help, Julie 😊