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

ServiceNow check for null or nil or empty (or not)

Haven't tested these all recently within global/local scopes, so feel free to have a play! option 1 use an encoded query embedded in the GlideRecord , e.g.  var grProf = new GlideRecord ( 'x_cls_clear_skye_i_profile' ); grProf . addQuery ( 'status=1^ owner=NULL ' ); grProf . query (); even better use the glideRecord  addNotNullQuery or addNullQuery option 2 JSUtil.nil / notNil (this might be the most powerful. See this link ) example: if ( current . operation () == 'insert' && JSUtil . notNil ( current . parent ) && ! current . work_effort . nil ())  option 3 there might be times when you need to get inside the GlideRecord and perform the check there, for example if the code goes down 2 optional routes depending on null / not null can use gs.nil : var grAppr = new GlideRecord ( 'sysapproval_approver' ); var grUser = new GlideRecord ( 'sys_user' ); if ( grUser . get ( 'sys_id' , current . approver )){

Get URL Parameter - server side script (portal or classic UI)

Classic UI : var sURL_editparam = gs . action . getGlideURI (). getMap (). get ( ' sysparm_aparameter ' ); if ( sURL_editparam == 'true' ) { gs . addInfoMessage ( 'parameter passed ); } Portal : var sURL_editparam = $sp . getParameter ( " sysparm_aparameter " ); if ( sURL_editparam == 'true' ) { gs . addInfoMessage ( 'parameter passed ); }