- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:11 PM
In all transparency, I am not great at scripting. I am using the scripting function in flow designer and I need help checking if my variables are null. if they are not null I would like the workflow to go to the next step. Below is where I started and I got stuck, please assist in any way possible.
Thanks,
Jewell
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2024 02:00 PM - edited 05-02-2024 02:42 PM
No worries, once you select an Item from the Conditions, the variable option appears in the condition.
I confirmed the functionality works in my PDI but noticed that it does take a minute or two for the Flow to detect that the variables have been updated.
FYI, in the previous script, there is a semi-colon that should be deleted
if ((candidateFound) && (cityLocation) && (stateLocation) && (startDate)); {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:39 PM
Hi @jaubert,
You can do this without any code at all.
- Add Get Catalog Variables from Acess, and populate them as something like the below. Make sure you select all the variables needed
Use 'IF' flow logic to check if the variables from the previous step are empty or not.
If you are keen on the script, something like the following will do:
var candidateFound = gs.nil(fd_data.trigger.request_item.variables.candiate_found);
var cityLocation = gs.nil(fd_data.trigger.request_item.variables.city);
var stateLocation = gs.nil(fd_data.trigger.request_item.variables.u_state);
var startDate = gs.nil(fd_data.trigger.request_item.variables.start_date);
if ((candidateFound) && (cityLocation) && (stateLocation) && (startDate)); {
return false;
} else {
return true;
}
Note that this will return false when ALL variables are empty.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2024 06:20 AM
Thank you for your response. If I use the no code solution proposed will this also allow me to pause until the variables are no longer empty? The "wait for condition" only allows me to select a table that is why I was using the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2024 02:00 PM - edited 05-02-2024 02:42 PM
No worries, once you select an Item from the Conditions, the variable option appears in the condition.
I confirmed the functionality works in my PDI but noticed that it does take a minute or two for the Flow to detect that the variables have been updated.
FYI, in the previous script, there is a semi-colon that should be deleted
if ((candidateFound) && (cityLocation) && (stateLocation) && (startDate)); {