"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

image is not opening

I have attached it

Regards
Harish

find_real_file.png

find_real_file.png

find_real_file.png

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi,

Created the following Action and Flow.

1.Action

Define Action input "employment_start_date" of type Date

find_real_file.png

Set Input of Script step to be Action input variable "employment_start_date"

find_real_file.png

Set Output to be of type True/False

find_real_file.png

Set Output of Action to be variable "truefalse" from step output

find_real_file.png

2. Create following Flow to test Action. Set employment_start_date to empty.

find_real_file.png

Log output from Action

find_real_file.png

Execution results in "true"

find_real_file.png

Hi, Thank you for quick response.
In test flow, if I test the action it was working fine. but, when we call the same action in our flow it is again returning false value

find_real_file.png 

By default before running to that step it is taking as false in truefalse output data