Task results are not being saved in the Morpheus results variable

When creating a task that uses Morpheus’s Task Results feature to output task results to Morpheus variable, you may come across a situation where the task results are not being stored. This may occur if the value specified for the CODE field has hyphen character in its name.

Hyphens are acceptable characters, but for it to work with task results, you will need to use quoted identifiers when referencing the results variable.

For example:

ipAddress= "<%=results.ip-address%>" - This will not work

ipAddress= "<%=results.'ip-address'%>" -  This will work as it is using a quoted identifier

We recommend that you use camelCase (‘ipAddress’), when specifying code values as they can be used in task results with normal identifiers “<%=results.ipAddress%>”, or quoted identifiers “<%=results.‘ipAddress’%>”

Please see the following reference guide for Groovy syntax:
https://groovy-lang.org/syntax.html#_normal_identifiers

Awesome tip @wabbas thanks for sharing :+1: