- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2016 09:09 AM
Hello all!
What I am ultimately trying to do is utilize the Approval User functionality in the workflow. The issue that I am having is that I can't get the specific variables I want to appear on the approval email. The variables that I want to appear in the email are: tra_staff_name, tra_emp_id and tra_manager.
I imagine that the best way to do this is to create a unique notification to tie to the approval in the workflow and that I will need to use a custom mail script. I have tried many different renditions and other community posts and haven't quite gotten what I wanted out of them. I do not want to list every variable on the item and it would be idea to have them in a nice format such as:
Staff Name: XXXXX
Emp ID: XXXXX
Manager: XXXXX
So how do I properly get my specific variables in a mail script and format it so that it looks nice to the user and not a jumbled mess?
Any help would be greatly appreciated!
Thanks!!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2016 09:17 AM
Use this in the email script
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(current.sysapproval);
set.load();
var vs = set.getFlatQuestions();
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getName()=='tra_staff_name' || vs.get(i).getName()=='tra_emp_id' ||vs.get(i).getName()=='tra_manager' ) {
template.print(' ' + vs.get(i).getLabel() + ": " + vs.get(i).getDisplayValue() + "\n");
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2016 10:46 AM
Sure, let me know how it goes