- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 04:44 PM
I have a workflow that has a run script activity that sets the RITMs short description like this:
current.short_description = current.cat_item.name + " - " + current.variables.<variableA>.getDisplayValue();
This has been working correctly until now. I don't know if it's because of the London upgrade but now my RITMs short description's current.variables.<fieldA>.getDisplayValue() is displaying the following string:
<variableB>:<sys_id>,variableA:<sys_id>,<variableC>:<selected value in form>
[variableB is a reference field as well in my form. Both variableB and variableC are part of the same variable set as variableA]
I put the following lines to see what was being printed:
gs.info("current.variables.<variableA>: " + current.variables.<variableA>);
gs.info("current.variables.<variableA>.getDisplayValue() " + current.variables.<variableA>.getDisplayValue());
The output of both lines is the same nonsense I mentioned above. This doesn't make sense because
current.variables.<variableA> should output the selected record's sys_id since variableA is a reference field.
current.variables.<variableA>.getDisplayValue() should output the selected record's actual display name and yet they are both displaying the same string.
Solved! Go to Solution.
- Labels:
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2019 01:07 PM
The issue was that <variableA> name was the same as the name of the variable set it was on.
they were both called computer_name so it was setting things in the wrong way. I changed the variable set name to something else and it got fixed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 04:48 PM
Can you also try current.variables.<variable>.name.
If it is a variable set, also try current.variable_pool.<variable>.getDisplayValue()
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 05:04 PM
Thanks for your reply,
With current.variables.<variable>.name I get undefined.
With current.variable_pool.<variable>.getDisplayValue() I get the same string as earlier.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 05:36 PM
Hi Kev,
Can you please try the following for me:
current.variables["variableA"].getName();
I was reading in ServiceNow docs about Workflow catalog variables and there may have been some changes introduced in London.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2019 01:07 PM
The issue was that <variableA> name was the same as the name of the variable set it was on.
they were both called computer_name so it was setting things in the wrong way. I changed the variable set name to something else and it got fixed.