Can I use an event parameter into Notification Next Experience Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 07:49 PM
I'm creating a provider notification that is triggered by an event. I'm unsure if it's possible to pass the event parameters to the Next Experience Content of the notification.
Is there a way or isn't possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 09:42 AM
I have the same question. I tried using ${event.parm2} in my 'Message' content and it came up blank, although I do see the expected value in Parm2 of the event in the log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2026 11:41 PM
any luck? if we can use {event.parm2} in messages ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
Hello @ArunaSukruM,
You can use Advanced field and use the eventParms in the script.
The script return a JSON object and can be used as shown below:
(function(current, eventName, eventParm1, eventParm2, previousActors) {
/**
* Generates a notification object based on the provided parameters.
* @param {GlideRecord} current - Reference to the table record
* @param {string} eventName - Name of the event that triggered the notification.
* @param {string} eventParm1 - First parameter related to the event.
* @param {string} eventParm2 - Second parameter related to the event.
* @param {Array} previousActors - List of previous actors who have triggered this notification.
*
* @returns {Object} Notification object containing the following properties:
* - actor: Sys ID of the user who triggered this notification.
* - messageContentTemplate: A translatable template for the notification message content.
* - messageContentParams: An string parameters to be inserted into the message content template.
* - aggregatedContentTemplate: A translatable template for aggregated notification content.
* - aggregatedContentParams: An array of parameters to be inserted into the aggregated content template.
* - actionUrl: URL for navigation when the notification is clicked.
*/
return {
actor: '',
messageContentTemplate: 'Return Value is: {0}',
messageContentParams: [eventParm2],
aggregatedContentTemplate: '',
aggregatedContentParams: [],
actionUrl: ''
};
})(current, eventName, eventParm1, eventParm2, previousActors);
Thank you and regards,
Harsh