Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Switch condition not working in workflow

Hari1
Mega Sage

Hi,

I have created a workflow using a switch block and the variable used inside the switch condition is a single line text. I see the switch block is stuck and does not move to the next block.

find_real_file.png

In the logs created through workflow see the typeof variable passed is object but when i log the variable single line text on the catalog it gives me as string. I am using activity.result == 'IN' in the switch conditions as per the regions.

find_real_file.png 

1 ACCEPTED SOLUTION

Hi Hemanth,

You cannot access workflow scratchpad inside switch activity

alternative here

Access Scratchpad from Switch Core Activity -Kingston

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please share image of switch activity

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Hemanth,

You cannot access workflow scratchpad inside switch activity

alternative here

Access Scratchpad from Switch Core Activity -Kingston

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Hemanth 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

KaMmILa__
Tera Expert

make sure you selected the correct variable and delete the switch and publish the workflow and then checkout and create the switch again and try.