ServiceNow Notifications - Showcase asset data in tabular view using email scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello there!
Need your input on a requirement mentioned below. Please go through it and let me know if you have an idea to achieve it. Thank you in advance!!
We're trying to retrieve asset data of a user and send a notification to that user with asset details in tabular view as mentioned below. FYI, It should work only if asset count>=1.
Can you please assist on how to build tabular view using email scripts within notifications?
Model Category | Model | Serial Number | State |
|
|
|
|
@Chuck Tomasi, @Ankur Bawiskar, @Krista Forget @Hitoshi Ozawa @Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @JSharathChandra ,
Yes, in ServiceNow, the usual way to build a tabular section inside a notification is to create a Notification Email Script, generate HTML, and then call that script from the notification body with ${mail_script:your_script_name}
Kind regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @JSharathChandra ,
You can use an Email Script to build the tabular view and call it inside the notification.
Steps:
Create an Email Script under System Notification → Email → Email Scripts.
In the script, query the alm_asset table where
assigned_to = current.sys_id.If asset count ≥ 1, build an HTML table using
template.print()with columns like Model Category, Model, Serial Number, and State.In the Notification → Message HTML, call the script using:
${mail_script:EmailScriptName}
This will render the asset details in a table format inside the email notification.
Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.
Regards,
Vaishnavi
Technical Consultant
