"If" condition in Flow Designer is evaluating as false every time. even though, it has to evaluate true. In Action it is returning "True" but in flow designer it is always returning "False" even the condition met

S_75
Giga Expert

I have a requirement to create a task if date field is empty. I have created an custom Action and it is returning true when date is empty which is correct but, when I called the same Action in the flow it is always returning false value which has to return true if Date value is Empty. How to get return value as "true" if date is empty and "false" if date field has some date.

Action Input Type is "Date"

Output variables Type: "True/False"

Action Output:-- 

find_real_file.png


Action script:--

find_real_file.png

Please help me out on this. Appreciated in advance. 

1 ACCEPTED SOLUTION

Can it be that the date retrieved from the record is null or undefined?

Add a check in Script.

(function execute(inputs, outputs) {
if (inputs.employment_start_date == null || inputs.employment_start_date == undefined inputs.employment_start_date == '') {
    outputs.truefalse = true;
} else {
    outputs.truefalse = false;
}
})(inputs, outputs);

View solution in original post

17 REPLIES 17

Would it not be simpler to just use

if (gs.nil(inputs.employment_start_date)) {
    outputs.truefalse = true;
} else {
    outputs.truefalse = false;
}

Just a thought...

Richard

It may be even simpler like below:

outputs.truefalse = gs.nil(inputs.employment_start_date);

very true 🙂