How to access reference variable in Flow Designer

manish123
Giga Guru

Hi All,

 

I built a flow designer on catalog item and it has got a reference variable "Action" and through the defined script include 3 actions are displayed like Add, Modify & Delete. I would like to check this variable "Action" value during the approval process and based on that will create catalog tasks. When I am using this variable through dot walk, it showing me as Translated text and validated as false. I tried with both these options:-

 

1) Get Catalog Variables --> Action --> Name (Type as Translated text) is Add

2) Get Catalog Variable --> Action is Add

 

But in both ways it is evaluated as False.

 

Can anyone help/guide me through this issue?

 

Quick reply will be much appreciated!!!

3 REPLIES 3

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

When you use the Get Catalog Variables action in Flow Designer, it returns the entire GlideRecord object of the record being reference. That means, you have access to all fields of the referenced record in your flow.

Screenshot 2023-01-01 at 19.54.39.png

 

So for your use case, you could work with any of those field, like Name or Sys_ID. You could also consider using a Decision Table instead of if/else condition in your flow, to make it more scalable.

Nasir Hussain1
Tera Contributor

Hello manish123,

 

Any luck figuring this out? I have a similar situation where the reference variable is not evaluating true and falls into else loop rather than the if loop.  

 

Below are the screenshots from Flow designer and Execution details. I can't figure out why this condition is evaluated False.

 

flow designer If Condition:

 

variable name ->Team->Name 

NasirHussain1_1-1675197349629.png

 

Runtime values:

NasirHussain1_0-1675197202847.png

 

Any help will be much appreciated.

Nasir Hussain1
Tera Contributor

Well Folks!

 

You can't believe it. The same condition worked this time.

variable name ->Team->Name 

 

I do not know why it was acting like that. It could be that I was testing it from the flow designer.  This time I activated the flow and tested it. It worked. Then I changed my workflow condition and it worked again. Something was causing that IF condition to be evaluated as false. I changed the flow,  click Done, Save, and then activated it.  See pic below.

 

NasirHussain1_0-1675700648625.png