- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 12:59 PM - edited 12-13-2023 05:55 PM
Hi Team, Good morning!
How to get the item variable value on the notification template?
there is a variable "Meeting date and time " and then put the value "2023-12-21 12:38:38 and the item ordered then I need to trigger a notification for XYZ group and the body needs to add the meeting time field on the notification and set the value item "meeting date and time" field for the only time.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:05 PM - edited 12-12-2023 11:07 PM
Hi @Alex78 try below
var time;
var dt = new GlideDateTime( current.variables.m_t); //Replace correct fieldname
var datetimearray = dt.getDisplayValue().split(' ');
time = datetimearray[1]; //returns time
}
template.print(time);
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 06:11 PM
Hi @Alex78 ,
Could you please create an Email script, Define this code on the email script, and call on the notification template?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 02:17 PM
You may need to add a mailscript to split the datetime field to get the time and print it.
It would be something like this
var d = current.variables.<variable name>;
template.print(d.split()[1]); // Get only the time
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 10:50 PM - edited 12-13-2023 05:54 PM
but still not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:05 PM - edited 12-12-2023 11:07 PM
Hi @Alex78 try below
var time;
var dt = new GlideDateTime( current.variables.m_t); //Replace correct fieldname
var datetimearray = dt.getDisplayValue().split(' ');
time = datetimearray[1]; //returns time
}
template.print(time);
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 10:11 AM
Sorry...One fix to the script
var d = current.variables.m_t;
template.print(d.split(" ")[1]);
Please mark this response as correct or helpful if it assisted you with your question.