The CreatorCon Call for Content is officially open! Get started here.

How to set a catalog variable value via the workflow?

nortonxnorris
Giga Expert

I have created a 'Yes/No' type variable. I would like to set the value to 'Yes' at a particular stage in the workflow using a 'Run Script'.

I have tried current.variable_name = 'Yes' which does not work. Any suggestions?

1 ACCEPTED SOLUTION

sorry...there was a mistake



current.variables.variable_name ='yes' ; // when its not part of variable set



current.variable_pool.variable_name = 'yes'; //when part of variable set


-Anurag

View solution in original post

5 REPLIES 5

decarlo
Giga Contributor

Norton,



Take a look at wiki post http://wiki.servicenow.com/index.php?title=Scriptable_Service_Catalog_Variables



You will need to do the following:



current.variables.<variable name> = <value>


or


current.variables.<variable name>.setValue('Yes');