Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Catalog Item Checkbox variable always returning false

juriggs
Kilo Expert

I have a checkbox variable in a catalog item, and no matter whether the box is checked or not upon the Order, the value returned if "false".

The code I'm using to retrieve the value is:

workflow.scratchpad.force_change = current.variables.force_change;

where force_change is the name of the variable in the catalog item and the input in the PowerShell activity in the Workflow.

Thanks.

1 ACCEPTED SOLUTION

juriggs
Kilo Expert

Okay, figured it out. 

In my Activity I had declared the force_change variable as a Boolean. In the workflow, when I told the activity what values I wanted to use, force_change was a checkbox that was unchecked.

When I changed the type of variable of force_change to String, the workflow activity input was a text box and I was able to put workflow.scratchpad.force_change = current.variables.force_change; in there. That worked.

Thanks for your help.

View solution in original post

4 REPLIES 4

Brian Lancaster
Kilo Patron

Do you have any client script running against this variable?

No. Just the script in the "Run Script" activity of the Workflow.

Try this??

workflow.scratchpad.for = current.variables.force_change;


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

juriggs
Kilo Expert

Okay, figured it out. 

In my Activity I had declared the force_change variable as a Boolean. In the workflow, when I told the activity what values I wanted to use, force_change was a checkbox that was unchecked.

When I changed the type of variable of force_change to String, the workflow activity input was a text box and I was able to put workflow.scratchpad.force_change = current.variables.force_change; in there. That worked.

Thanks for your help.