How do I dereference service catalog variables in flow designer

ericames
Kilo Contributor

ericames_0-1726269781820.png

Two of my variables are working as I expect.  Ticket_number and number_of_instances.  The rest are grayed out.  Not sure what I have to do to unlock this.  Thank you in advance for the help! 

3 REPLIES 3

Craig Gruwell
Mega Sage

From the screenshot, it appears you're trying to use the variables as part of JSON-type input value and it seems to limit only to String type variables.   

 

Option 1:  You might have to create and store any non-string values into Flow Variables (of String type) and then you should be able to use them. 

 

Option 2: Toggle the scripting on and then dot walk to the catalog variables.

 

Craig thanks for the feedback.  Do you have any links that might help me make a decision?  I have no formal servicenow training.  Thank you!

Sure -

 

Option 1:

Create Flow Variable - https://docs.servicenow.com/bundle/xanadu-build-workflows/page/administer/flow-designer/task/create-...

Set Flow Variables flow logic - https://docs.servicenow.com/bundle/xanadu-build-workflows/page/administer/flow-designer/concept/flow...

 

Option 2:

The second link above also includes an example of the dot-walking - see "Example: Set the incident number variable value using a script".

 

The script might look something like this:

var result = {
  "color": fd_data._1__get_catalog_variables.select_color,
  "desc" : fd_data._1__get_catalog_variables.description
 }

return result;
 
This assumes you have added the "Get Catalog Variables from test catalog item" action as the 1st step in the flow and added the variables you'll be referencing.