Hi,
I’m trying to build a form, that will calculate a score depending on which attributes are selected.
I’ve started off trying to test, I could return a value, if the variable matched.
I have a variable called Gradient which should return the value of a lookup attribute.
And a parameter with a script to add 20 if the “Gradient” variable matches an AlloyId
But the script doesn’t get True condition when tested. The output is 0 instead of 20.
{
"ancestorId": "",
"signature": "",
"description": "Test conditional logic",
"parameters": [
{
"discriminator": "WorkflowComputedItemAttributeWebModel",
"attributeCode": "attributes_gritBinCriteriaFormScore_654b90e5be0fff779ced3447",
"value": {
"discriminator": "WorkflowSyntaxNodeScriptWebModel",
"script": "var myNum = 0; if (Gradient[0] == AlloyId(\"654b85cd2b32a3b7d64911fe\")) {myNum+=20;} return myNum;",
"returnOptions": null
}
}
],
"variables": [
{
"name": "Gradient",
"value": {
"discriminator": "WorkflowSyntaxNodeInputWebModel",
"inputParent": 0,
"itemValue": {
"discriminator": "WorkflowSyntaxArgumentItemValueAttributeWebModel",
"attributeCode": "attributes_gritBinCriteriaFormSeverityOfGradient_654b892cd420bc4aab4d65e0"
}
}
}
],
"actionDesignCode": "designs_workflowEditItemAction"
}