Skip to main content

ServiceNow - Outlook actionable messages (OAM) in embedded surveys - FIX

 

update on ServiceNow support ticket 

had a zoom call and the servicenow engineer informed me that a code snippet was missing from the ServiceNow online documentation (ref: https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/administer/survey-administration/task/embed-survey-in-outlook-email.html ) that needs to go in the notification:

in addition to,

${mail_script:include_survey_actionable} 

need to add in:

${mail_script:asmt_assessment_instance_script}

 

(this loads:
var html = new AssessmentUtils().getInstanceLinkHTML(current);
template.print(html);

)

it unfortunately hasn't resolved the issue so ServiceNow are continuing to investigate and advise

they have also made us aware of a few KBs:

https://support.servicenow.com/kb?id=kb_article_view_popup&sysparm_article=KB0791126 https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0750361

 

=======

further info from ServiceNow:


Solution proposed is :

Hi Ruen,

I hope you are doing well.

It took me some time to set up the instance and surveys, but I was able to obtain a successful run on the first go from an in-house instance.
Steps I followed to achieve this below:

  1. installed the OAM plugin
  2. in survey notification, added ${mail_script:include_survey_actionable} to notification message
  3. in surveys, created a new survey and enabled (ticked) the Outlook Actionable Message check box
  4. created a test trigger condition to trigger the survey (this however was not necessary - see step 6)
  5. publish the survey
  6. assign the survey to user (this will trigger the survey notification regardless of trigger conditions)

I referenced our Official Docs at the link below as well as few other resources (previously shared on this case) to validate the correct setup:

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/survey-administration/task/embed-survey-in-outlook-email.html

KB0759780

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0759780

When I received the notification, the whole body of the email was replaced with the actionable message and I was able to fill in the survey directly from my Outlook.
For the purpose of this test I only added a mock question of type string to the actionable message which worked correctly.
One thing I noticed is that the whole body of the actual notification was replaced by the actionable message.
This happened because I added the mail script above (step 2) at the top of the body of the notification message.
I tested this again after moving the script at the bottom and the body of the notification was displayed correctly, followed by the actionable message.

Based on the successful execution above, other workarounds/solutions tried in this case can be ignored and the steps I shared with this message should be used instead.
In other words, only the mail script is needed for a notification to contain the actionable message (found a total of 3 survey notifications in mojcppdev, none of which contains this script).

Please let me know if the above is helpful or you have other questions I may assist you with.
Should you need more guidance or would like to review the above together kindly consider sharing your availability to join me in a 30 mins Zoom session and we can go through the details on a call.
If I was able to resolve your issue, please let me know by accepting the solution.

Many thanks for your patience and collaboration.

Best regards,

Luca 

 

 

 

Comments

Popular posts from this blog

URL link in addInfoMessage

var ga=new GlideAjax('gld_HR_ajax'); ga.addParam('sysparm_name', 'checkEmployeeNumber_hrProfile'); ga.addParam('sysparm_hrprofilenumber', g_form.getValue('number')); ga.addParam('sysparm_employeenumber', newValue); ga.getXMLAnswer(function(answer) { if (answer!='undefined' && answer!=''){ var navURL="<a style='text-decoration:underline;color:blue' href=hr_profile.do?sysparm_query=number=" + answer + ">" + answer + "</a><img width='3' src='images/s.gif'/>"; var sMsg='The employee number entered already exists on another HR Profile ' + navURL; //alert(sMsg); g_form.showErrorBox('employee_number', 'error - please check'); g_form.addInfoMessage(sMsg); } });

GlideRecord setValue

setValue(String name, Object value) Sets the specified field to the specified value. Normally a script would do a direct assignment, for example,  gr.category = value . However, if in a script the element name is a variable, then  gr.setValue(elementName, value)  can be used. When setting a value, ensure the data type of the field matches the data type of the value you enter. This method cannot be used on journal fields. If the value parameter is null, the record is not updated, and an error is not thrown https://developer.servicenow.com/app.do#!/api_doc?v=madrid&id=r_GlideRecord-setValue_String_Object