Reference variables that are inside of a variable set in a workflow

dbrennan
Kilo Contributor

Hey everyone,

I have a variables set that I created that contains multiple variables such as name, email, role, etc.

This is for a catalog item that on-boards new users to an app we use for project development.   This catalog item runs a WF that calls an api to add new users to the app.   The issue I am running into is that I cannot reference the variables I need inside of the variable set using the normal current.variables.name_of_variable.

Is there a special way you have to follow in order to properly reference variables that are contained inside of a variable set?

Due to specific policies my org has set in place for developing on their ServiceNow instance, I cannot put in bulk requests items on a single request any other way that through the use of a variable set which is why I have to figure out a way to do it this way.

Any help would be much appreciated!

Thanks,

Devlin

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

Hi Devlin,



Did you try current.variable_pool.variable_name? Usually current.variables works for variable set. But you can also access a variable set value using variable_pool.



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

8 REPLIES 8

SanjivMeher
Kilo Patron
Kilo Patron

Hi Devlin,



Did you try current.variable_pool.variable_name? Usually current.variables works for variable set. But you can also access a variable set value using variable_pool.



Please mark this response as correct or helpful if it assisted you with your question.

Yeah, for whatever reason neither one of those works.



I have tested this before on my own personal developer instance and it worked just fine but suddenly whenever i make the api call it give me a response saying all of those variables were empty.


Can you post your code here



Please mark this response as correct or helpful if it assisted you with your question.

Oh wait!   I see what part of my issue is.   So I'm actually not supposed to be referring to the variable set variables but rather the ui page table that this information is placed inside of.   This may be pretty complicated.



Here is a picture of what my form looks like with an example request entered.


Screen Shot 2017-07-27 at 1.44.16 PM.png


so in this picture the text boxes are all the variables from my variable set.   Once you click the add button it adds the information about that user into the table you see below.   What I need to figure out is how to get that information from the table below into my workflow.



Any idea how to do that?



This is the issue because I ran this request without hitting the add button but rather with the text boxes populated with all the information and the workflow ran fine.   So the issue is that I'm referencing the wrong information.