Using a MRVS variable as a Switch option in a workflow not progressing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 02:27 AM
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.
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).
Here are the results of the workflow action
Any help is appreciated. Thank you in advance, Julie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 03:40 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 09:32 AM
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 😊