I have to enable email preview on workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2025 07:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2025 12:42 PM
It would be a great customization for the system.
You would need to create a new button and write code to fetch the email content and display it as a preview.
You can use the email logs to generate the preview.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2025 09:06 AM
hi, did you find out how to do that? i have a similar situation.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2025 12:44 PM
Hello @Nivetha23jay
This is interesting to see. I see two options, the first one is obvious to enable existing "preview action by going to sys_email table > UI action (Preview HTML Body). Make It enable to workspace, save & test.
2nd approach which I would do is creating a Brand new UI action on sys_email table and make workspace form button to Checked/True.
.
(function runPreview() {
// Use the built-in 'email_preview' UI Page to render the body
var modal = new GlideModal('email_preview');
modal.setTitle('Email Preview');
modal.setSize('large');
modal.addParam('sysparm_sys_id', current.sys_id);
modal.render();
})();
There is a UI Page named preview_email (oob or one you clone) that reads the sysparm_sys_id parameter, loads the sys_email record, and prints its subject and body (HTML or text).
You can explore more here by checking the documentation
https://www.servicenow.com/docs/csh?topicname=c_GlideModalV3API.html&version=latest
Try this and mark my reply as correct if you answer your questions.
Thanks
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2025 12:47 AM
Hello Anand, very good example, but in workspace we cant use GlideModal, only g_modal. Do you have any idea how to achieve the preview email button in this case?