How to get requestor name variable value in workflow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 10:10 AM
I tried:
requestor = current.variables.requested_for.getDisplayValue();
and
requestor = current.variables.requested_for.name;
I am not sure what the variable name is and why it is not showing up with a value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 10:58 AM
Hi,
Please try below code once,
answer=current.variables.requested_for.toString();
Hope this helps!
If you have any more questions, please let me know.
If I have answered your question, please mark my response as correct and helpful.
Thanks,
Sriram

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 10:47 AM
your workflow is running on which table ?
try to add log and see what are you getting in log
var rName = current.variables.requested_for.getDisplayValue();
gs.log('requester name '+ rName);
Note: make sure you have mentioned correct variable name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 11:07 AM
It should be the the request table right for RITM tickets. I am not sure where to see gs.log entries, so I used:
workflow.scratchpad.requestor_name = current.variables.requested_for.getDisplayValue();
This returns nil value. Isn't the requestor name a pretty standard thing on request catalog items?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 11:08 AM
Any cool trick to see all the variables?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 11:13 AM
if your workflow is running on request table, try with below script
var gr = new GlideRecord('sc_req_item');
gr.addQuery('request',current.sys_id);
gr.query();
if(gr.next()){
workflow.scratchpad.requestor_name = gr.variables.requested_for.getDisplayValue();
}