Is is possible to check if the output of a custom code is known?
I have a scenario where there is some custom code that accepts a set of inputs and the same set of output. The problem is the workflow is not always passed the full set of inputs, as a result I cannot just assign the output of the workflow since it isn’t always defined. I’d like to check if it is present first. Is this possible?
@EFiori - I hope I am understanding your problem statement correctly - in effect the code logic does not always result in a defined property value that can be passed to the parent workflow.
I have encountered this a number of time in different formats - and my solution in most of these has been the assignment of a default value to the output property as the code initailizes so there is no path through the code that leaves that value undefined.
A trivial example might be code that find the value of a record ID (via a search or similar).
The first few lines of my code might include recordID = “XXXX” (in Python that is).
Then, if the record I’m searching for is found, the a valid digit string is inserted. Otherwise the code can terminate with the “XXXX” value passed back. I use an actual recognizable string here rather than a None assignment because the chances is that a subsequent copy value step willl fail with a None value.
This picture might illustrate things better - I have an output value that I’m not sure will be present, so I’d like to avoid the copy propety step in that case, but I’m not sure how…
As far as I can tell, the only way right now to skip step 2 per your screenshot is to actually branch on the good value or non-value of the “outcome” code. Which is why I suggest above making sure there is always something other than a Null/None value in the returned code. At least now you can reference that return value directly without an intermediate storage step.