How to display Answer for Assessment which is choose by requestor in Emil Body?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2022 09:55 PM
Hi Team,
How to display Answer for Assessment in Emil Body?
I have created notification on "asmt_metric_result" Table. I want to display One of the assessment answer which is choose by requestor in notification body.
Notification Table - asmt_metric_result
Condition
Metric - Question
String Value - Answer
What will contain
I want to display one of the Assessment answer in Email Body
Question in Assessment - Please select countries
Answer may be multiple countries (Multiple select box)
Please suggest.
Regards,
Sruthi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2022 05:09 AM
Hi Shruti,
You will have to write email script to show all countries in email body. Use below script,
var countryArray=[];
var grCountry=new GlideRecord("core_country");
grCountry.addEncodedQuery("sys_idIN"+current.country_variable_name_here);//replace 'country_variable_name_here' with your field name
grCountry.query();
while(grCountry.next())
{
countryArray.push(grCountry.getDisplayValue());
}
template.print(countryArray.join(","));
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP