Current.variables.<variable name> not working in my catalog item's workflow

Shant Cancik
Tera Contributor

My workflow has an "Approval User" activity with a script that uses a Gliderecord to filter a table

Here is my code:

var target = new GlideRecord ('u_application_table);
target.addQuery('name', current.variables.what_app_name);
target.addQuery('u_permissions', current.variables.what_permissions);
target.query();

I'm trying to use current.variables.<variable name> in lines 2 and 3 to pull the values of the variables what_app_name and what_permissions. If I replace them with a string like 'hello' I do get results but doing it the way I do above gets me nothing. Am I doing something wrong? These variables are lookup select boxes that reference two columns in my application_table table. I'm wondering if the fact that they are references is whats messing something up.

19 REPLIES 19

Harsh Vardhan
Giga Patron

Hey Harsh,



Unfortunately this didn't solve my problem. The variables I'm trying to pull the data from are in my catalog item. Using workflow.variables.<variable name>   within the javascript section in my workflow activity doesn't seem to retrieve that data. Any thoughts on this?


on which table you are writing that above script?



get value of a variable set inside a workflow


Hi Harsh,



The script is run in the sc_request table which I believe is correct? After noticing some information in the link you sent me I want to add that the variable is in fact a reference variable to a field on a table. I believe my script might be pulling the sys id of the fie reference field? I'm not sure how I'd verify that nor do I know how to fix it. I need the value not the sys id