- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Scenario is there is a record producer , i want to send a email notification when ever the record producer submitted only when on one particular choice for a question but problem is the receivers email are based on the user input in RP , and some variable of RP i need to show in notification body and those variable are NOT MAPPED in the table. What can be done.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
why you want to use producer.variableName?
The approach I suggested is to use after insert BR and syntax to get variable value is this
current.variables.variableName
it's simple
-> create event on your table
-> create notification which triggers based on the above event
a) set event parm1 contains recipient - True
b) set your body, subject etc
-> create after insert BR which checks your variable value
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.variables.variableName == 'your choice value'){
gs.eventQueue('eventName', current, current.variables.variableNameForRecipient); // give here the variable name from where recipient should be picked
}
})(current, previous);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
no issue
-> you can create after insert BR on the target table of that record producer
-> in that BR script check the value of that variable
-> use gs.eventQueue() to trigger event and include the recipients and include in event parm1
-> in notification ensure Event parm1 contains recipients is marked as True
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Those variable i want to use are coming from variable set of record produce , i can access them using producer.varaible_name ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @SujitK ,
yes, you can!
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
why you want to use producer.variableName?
The approach I suggested is to use after insert BR and syntax to get variable value is this
current.variables.variableName
it's simple
-> create event on your table
-> create notification which triggers based on the above event
a) set event parm1 contains recipient - True
b) set your body, subject etc
-> create after insert BR which checks your variable value
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.variables.variableName == 'your choice value'){
gs.eventQueue('eventName', current, current.variables.variableNameForRecipient); // give here the variable name from where recipient should be picked
}
})(current, previous);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
