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-12-2017 08:00 AM
Hey Raymond,
Correct, the request does not have a workflow running. It did originally and had an activity that automatically approved the request but I modified the workflow for the needs of this catalog item and moved it to run on the sc_req_item table. Doing that made the request approve activity meaningless. We've just decided that we'd rather not have the request at all. Our workflow is connected and functioning well with our RITM and we'd rather just be able to link a user to submitting the RITM without having it encapsulated in a Request (which we currently have to manually approve to get the RITM workflow to trigger).
Know of any easy way to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 08:40 AM
do you have an individual workflow for EVERY item on the request table.. or did you just break the request workflow for ALL requests??
if this workflow ran on all requests not just this item... recreate it and validate it works.. that should resolve your issue.
if you DO have a request level workflow for all items.. why.... i would look at standardizing on a single request workflow... if you can't just create a workflow on the request table that marks it approved <the request not the item> and your workflow will start as soon as that one finishes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 02:10 PM
i see the line target.addQuery('name', current.variables.what_app_name);
in your variables is what app name a reference field to an application.. if so you need to change the query to be on the sys_id instead of name field or change it to .current.variables.what_app_name.name
if it is a free text field this is going to be a MAJOR issue as the odds of the user typing the name in exactly as it appears in the cmdb are about zero
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 07:16 AM
Yes it is a reference field to a column of a table. When running my workflow isn sc_req_item I am now getting the value I want through current.variables.what_app_name which is great. The problem is the request itself isn't being automatically approved. I had an activity that did that in my workflow but that was when it was running in the sc_request table and not the sc_req_item table like it is now. My workflow isn't triggering untill I approve the request manually now.
Any idea on how I'd resolve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 04:23 PM
Hi,
Did you ever find a solution? We just moved to Jakarta and I am creating my first catalog item since we upgraded. I have a workflow that I am trying to use current.variables, which has always been successful in the past. My plain text field comes through fine however, my user I get from the user table and my other field I get from another table also come through as undefined. I have tried current.variables.varname.toString(), .getDisplayValue(), .getReference(), getValue() and just the plain old current.variables.varname and every single one comes through my logs as undefined. My workflow is on the sc_req_item table.
Thank you so much,
Stacy