- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2021 04:33 AM
Hi experts,
I am using flow designer , in which I need to wait until all the existing response tasks are completed and then move further.
I am using wait for condition action in flow designer ad have written a script for it. But when I check flow execution it shows an error- java.lang.Boolean cannot be cast to java.lang.String
This is how the flow looks like currently.
script in wait for condition is -
var cnt_task;
Solved! Go to Solution.
- Labels:
-
Security Incident Response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2021 10:55 PM
Hi,
As suggested by Muhammad you will have to change the logic.
You will have to write after update BR on sn_si_task table and mimic an update on sn_si_incident so that flow proceeds once wait for condition evaluates to true
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
01-01-2021 09:01 AM
Hi,
Please use:
answer = true; or answer = false; instead of "return".
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2021 10:40 AM
Hi Allen,
Thanks for reply.
I tried that way as well, it does not give any error but the flow proceeds further instead of waiting.
Is there anything else I am missing?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2021 12:23 PM
You may have missed it when you deleted the commented code but the scripted field only accepts an encoded query to be returned, not a boolean value.
Have a look at some of these options for waiting for child tasks to close in flow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2021 12:35 PM
Hi kalyani,
1. "Work for condition" only works for the condition set for the table on which the flow is triggering. i believe your flow is triggering on sn_si_incident and the filter is returning for sn_si_task table that will not work.
2. As kieran already mentioned, it requires encodedQuery or the value returned for the object/field of the source table.
Hope that helps!
Regards,
Muhammad
Muhammad