Hello!
I’m poking at the If/Else Conditional Workflow type task but I keep hitting an error around:
Cannot convert null value ‘undefined’(language: JavaScript, type: undefined) to Java type ‘boolean’ using Value.asBoolean(). You can ensure that the operation is supported using Value.isBoolean().
No matter what I try. I’m sure I’m missing something simple.
I have a task with a really simple Powershell array that gets converted to JSON and ‘write-output’:
$RESULTSOUTPUT = @{}
$RESULTSOUTPUT.add("Unzipping Results", "Success")
$RESULTSOUTPUT.add("MECM Innstallation", "Success")
$RESULTSOUTPUT.add("Success", "True")
Write-Output($RESULTSOUTPUT | ConvertTo-Json)
Exit 0
This is set to be registered to Code “MECMsuccess” with Result Type JSON
I then have a debug task that just does write-output(“<%=results.MECMsuccess.Success%>”)
and that spits out True as expected
The next step is the If/Else Conditional Workflow task, which I setup with information from Looking guidances for triggering multiple automation tasks based on user inputs Yes/No in service catalog - #2 by Tyler_Boyd as my example:
if (results.MECMsuccess.Success == “true”) {
true;
} else if (results.MECMsuccess.Success == “false”) {
false;
}
(I also tried using three ==='s as the text block has two but if you click to expand the screenshot you can see there are three there).
The results I get no matter what are:
Error Executing Conditional Workflow Task _Catalog - MECM Email Logic - Cannot convert null value 'undefined'(language: JavaScript, type: undefined) to Java type 'boolean' using Value.asBoolean(). You can ensure that the operation is supported using Value.isBoolean().
This holds true even if I adjust things to just be a Single value result or a Key/Value. I’m not sure what in the Boolean is going on.