Current.variables.<variable name> not working in my catalog item's workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2017 01:32 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2017 01:36 PM
workflow.variables.what_permissions
http://wiki.servicenow.com/index.php?title=Using_Variables_in_a_Workflow#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 07:16 AM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 09:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 09:28 AM
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