- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 01:35 AM
Hi,
I added description (${description}) variable in notification body. The description contains these details
Area: Mid-West
Restaurants : 1111_California
Specific Shifts: Weekends, weekends
Issue : test
So I need to fetch 1111_california from body and add to subject line.
eg: Subject line should be Test/1111_california.
I tried writing notification email script using split(':'). I am getting output as 1111_CaliforniaSpecific Shifts
Thanks in advance
Thanks,
Anoja
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 01:54 AM
Hi Chekuri,
Try below
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var roundingoff = current.business_percentage;
template.print(Math.round(roundingoff));
var desc=current.description;
var gettextis=desc.split('Restaurants :')[1];
var onlyrest=gettextis.split('Specific Shifts ')[0];//this give required value after Restaurants: and before Specific Shifts
email.setSubject(onlyrest+'is the Restaurant');
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 02:02 AM
Hello @Anoja
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 01:54 AM
Hi Chekuri,
Try below
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var roundingoff = current.business_percentage;
template.print(Math.round(roundingoff));
var desc=current.description;
var gettextis=desc.split('Restaurants :')[1];
var onlyrest=gettextis.split('Specific Shifts ')[0];//this give required value after Restaurants: and before Specific Shifts
email.setSubject(onlyrest+'is the Restaurant');
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 02:13 AM
Hi Jaspal,
Thank you so much. It worked for me.
Thanks,
Anoja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 02:02 AM
Hello @Anoja
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh