Custom action returning false even if it's true - need help

gjz
Mega Sage

The business requirement is to allow fulfillers to create manual catalog tasks for a specific RITM for any reason.  The workflow for the RITM needs to wait until all of the manual tasks are complete before closing the RITM.  In the current workflows, this is accomplished by a "Wait for Condition" script step before closing the RITM.

gjz_0-1695915921977.png

gjz_5-1695916584747.png

 

To do the same thing in Flow, I've created a custom action using the same script, but when I test it, it always returns false and I don't know why.  Can someone help me spot what is wrong?

 

Action input = RITM sysid (GUID data type)

Action output = hasManualTasks (True/False data type)

 

gjz_1-1695916061797.png

I put in some logging and verified the script is working correctly; if there are open tasks it follows the true route and if not, if follows the false route.

gjz_2-1695916316088.png

gjz_3-1695916382541.png

gjz_4-1695916487613.png

 

And since someone will mention it, I do realize the true/false on the workflow is different from the flow script.  I've tried it both ways in the flow script with the same result, it always returns false.

 

 

2 ACCEPTED SOLUTIONS

gjz
Mega Sage

Wow, I just found the answer - I used capital letters for the output when it is all lower case.  It's working now!

View solution in original post

Sandeep Rajput
Tera Patron
Tera Patron

@gjz You are using Label to set Output instead of the name.

 

Set the output as follows.

 

if(sc.next()){
outputs.hasmanualtasks=true; //use variable name instead of label
}
else
{
outputs.hasmanualtasks=false; //use variable name instead of label
}

View solution in original post

3 REPLIES 3

gjz
Mega Sage

Wow, I just found the answer - I used capital letters for the output when it is all lower case.  It's working now!

Sandeep Rajput
Tera Patron
Tera Patron

@gjz You are using Label to set Output instead of the name.

 

Set the output as follows.

 

if(sc.next()){
outputs.hasmanualtasks=true; //use variable name instead of label
}
else
{
outputs.hasmanualtasks=false; //use variable name instead of label
}

Yes, I just noticed that before you answered and that is correct.  I'll mark yours as correct instead of my answer, you explain it better for others who may have the same issue.