- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2021 08:48 PM
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.
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2021 09:17 PM
Hi Hemanth,
You cannot access workflow scratchpad inside switch activity
alternative here
Access Scratchpad from Switch Core Activity -Kingston
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2022 04:37 PM
I had a similar situation and I have been doing and redoing the workflows believing that I am missing something. What is more weird is, one condition in the switch would work all ok and the approval groups are attached correctly but for the other it just wouldn't work.
After many attempts trying to fix it, I gave up and tried multiple IF blocks as a workaround.
Edit: Yesterday after I posted the above comment, I sat down today again to figure out why a condition on the switch would work while the other would not. It just seemed weird to me. What I noticed is in the Run script before the switch, the value being set was different than what it should be. To be more precise, it was truncating the value from the end. Maybe it could accept only a certain length of value. So I shortened the value in my original select choice and then Voila! it worked like a charm. Still unsure about why it would not accept the previous value.
Do let me know if any one of you have faced such a situation and if you have any explanation to the same.
Hope this helps someone! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2024 01:32 PM
Had the same issue! Apparently 40 characters is the limit. Anything above 40 doesn't run in the switch activity.