How to send the mrvs variables details with table format
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 12:40 AM
Hi Everyone,
I have a requirement to send the notification with MRVS variables details when the user submit the request
below are the variables
i am looking for email script, could you please help anyone with script
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 12:57 AM
Hi @Brahmi Pandla - something like this -
(function runMailScript(current, template, email, email_action, event) { // Get the MRVS data from the current sc_req_item record var mrvs = current.variables.travel_details; // add your MRVS internal name
// if MRVS has data
if (mrvs) {
// stored as JSON string
var rows = JSON.parse(mrvs);
// Check rows
if (rows.length > 0) {
template.print('<b>Travel Details:</b><br>');
template.print('<table border="1"><tr><th>Departure Location</th><th>Arrival Location</th><th>Departure Date</th></tr>');
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
// Access the variables using their internal names
var departureLocation = row.departure_location || '-';
var arrivalLocation = row.arrival_location || '-';
var departureDate = row.departure_date || '-';
// Add row to the table
template.print('<tr><td>' + departureLocation + '</td><td>' + arrivalLocation + '</td><td>' + departureDate + '</td></tr>');
}
template.print('</table><br>');
} else {
template.print('<b>Travel Details:</b> No travel details provided.<br>');
}
} else {
template.print('<b>Travel Details:</b> No travel details provided.<br>');
}
})(current, template, email, email_action, event);
Thanks.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 02:29 AM
Hi Tushar,
Thanks for your response
is it possible to call email script in work flow notification activity?