- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 10:35 PM
Hello everyone,
Now that I got the dedicated approval notification to work, how do I display specific variables from the sc_req_item table on the approval notification?
I found where I can get the summary of requested items using the below mail script. This seems to get all the variables (and works). But I need to get only five variables and my approvers want to see it in a specific table based format (fun).
If I was using a notification using the sc_req_item table, I would use ${variables.<variablename>}, but since I am using the sysapprover_approver table how do get these specific variables?
<mail_script>
template.print("Summary of Requested items:\n");
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", current.sysapproval);
gr.query();
while(gr.next()) {
template.print(gr.number + ": " + gr.quantity + " X " + gr.cat_item.getDisplayValue() + " at " + gr.cat_item.price.getDisplayValue() + " each \n");
}
TIA
Nick
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 08:42 PM
Can you Try using ${sysapproval.variables.VARIABLE_NAME} to get Variables data from RITM
Also refer to below link which is similar to your Requirement
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 04:23 PM
Hello @Niel5
Yes, that is what I was looking at as I specified in my original post as:
I found where I can get the summary of requested items using the below mail script.
But I need a different format for managers with specific variables listed in a specific format.
Thank you.
Nick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 04:33 PM
Got what you mean. For us we exclude some known variables from displaying. Maybe you can change the conditions to ==
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 08:42 PM
Can you Try using ${sysapproval.variables.VARIABLE_NAME} to get Variables data from RITM
Also refer to below link which is similar to your Requirement
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 08:26 AM