Scripting Wait For Condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 07:51 AM - edited 04-08-2025 08:02 AM
I am trying to script the Wait For Condition and have it check for the value of a catalog variable.
The catalog variable is "approval_check", and I want the Wait For Condition script to wait until "approval_check" == "Yes".
approval_check is just a string with a default value of "No".
I attached photos of my Wait for condition script, and the error I am getting which is "Error: Cannot read property "variables" from null,Detail: Cannot read property "variables" from null".
Here's the script.
answer = ifScript();
function ifScript() {
if (current.variables.approval_check == 'Yes')
return 'yes';
else{
return 'no';
}
}
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 10:41 PM
Hello @jerryl7,
As per the best practise, current object cannot be used in flow designer and hence flow gave null value while running. I would suggest to use the OOTB action - Get catalog variables in the start of steps. This would give you variables of your desired catalog item and their values.
You can use them in wait for conditions explicitly or use values using the fd_data object in case you use scripting.
Please give a try and i am sure your issue would be resolved.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Thank you,
Rajesh