How to use 'catalog variables' in conditions or adavanced conditions on email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 03:33 AM
I have written my Notification on sysaproval_approver table. So the catalog variables on RITM table. I am not sure how can I add catalog variables in condition or advanced conditions.
Just assume the catalog variable 'Access' is a Type of Select Box with options prod and non_prod.
So my Notification should be executed if the Access(catalog item variable) is non_prod.
or is it possible by writing script in Advanced condition(under When to send) like below:
var v = current.sysapproval.ref_sc_req_item.variables.access;
answer = v?"true" == v:non_prod;
I tried with above code but the notification is not triggering.
I tried to put some logs:
gs.log(v) is printing- non_admin but when I try to print gs.log(answer)- it's False so that might be the reason.
Kindly help me what was the issue with my script in advanced condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 04:12 AM
Hi @Sarah Bouil ,
Rather than triggering it from the sysapproval_approver table, why can't you trigger it from the Requested Item table like below. If you can't see variables in the condition, search for "show related fields" and then try again.
You can select the your catalog item name in select item & access variable in the select variable. Mark as solved if my response helps.
Regards,
Dhanraj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 04:47 AM
See my requirement is when the user receives the approve or reject email. They will click on that link then it should be take to the ServiceNow sysapproval_approver table so that person can approve or reject the RITM approval request. So I have written custom notification on sysapproval_approver table. Now this Notification should be execute if the Access(catalog item variable) is non_prod.
So is it possible to put catalog variable in condition or advanced condition in When to send in Notification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 04:17 AM
Hello @Sarah Bouil ,
current.document_id.variables.variable_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 06:32 AM - edited 04-03-2024 06:39 AM