Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Custom Notification Preview

Jon23
Mega Sage

I am currently working on creating a custom Notification Preview, utilizing the OOB functionality found in notification records. I have successfully copied the OOB code and display the notification, but I would like to take it a step further.

 

Specifically, I am interested in pre-selecting the Preview Record. Is there a way to pass a parameter that sets the Preview Record value? Any guidance or suggestions on this would be greatly appreciated.

 

Jon23_0-1761170854659.png

1 ACCEPTED SOLUTION

Jon23
Mega Sage

I ended up creating a custom UI page. This custom UI page calls a script include that gathers all the components such as layout, subject, and body. Once these components are collected, it replaces the ${..} tags with values from a record. The HTML is then passed back and displayed to the user in the modal.

View solution in original post

5 REPLIES 5

svirkar420
Tera Guru

Hi @Jon23 , This is not necessary the record preview is for showing you how will this notification looks to the recipient and that is how it will look to the recipient just with the users parameters, So there is no need to pass the exact parameters every time.  It will be passed down when needed.

 

If this answer helps you in any way make sure to Mark this as accepted solution and give a thumbs up this will also benefit others as well.
Regards.
Saurabh V.

Ankur Bawiskar
Tera Patron
Tera Patron

@Jon23

what's the business requirement of this? 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar  - we have process owners that have a desire to manage their email notifications. Our custom app will allow them to modify subject/body content (includes dynamic data). With this ability they would need to be able to preview their changes.

@Jon23 

need to explore from my side, will check if time permits

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader