"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

find_real_file.png

find_real_file.png

when i am checking that employment start date field based on any record it is returning false like below

find_real_file.png

The images aren't showing.

It's necessary to save the image to local pc and to "Insert Image" from local pc to show image.

My reply is executing the Action from a Flow and it's returning "true". There's something in the Action and Script that's being executed that is different from Action and Flow in my reply.

 

I did the same saved the screenshots in local pc and then uploaded

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);

Thank you so much. this is working Finally