logo

NJP

ServiceNow integration with WhatsApp

Import · May 24, 2020 · article

This video demonstrates how we can provide an option to the users who are working on the tickets to have the luxury to directly communicate with users via WhatsApp. Steps followed are as below: 1. Uploading the image. 2. Creating a UI Macro. Code for the function is as below: function userWindow(reference){//incident.caller_id var refVal = reference.split('.'); var fieldName = refVal[1]; var mob; var demotext; var sysId = g_form.getValue(fieldName); var user = new GlideRecord('sys_user'); if(user.get(sysId)){ mob = user.mobile_phone.toString(); demotext = 'Hi '+user.first_name; } mob = mob.replace(/[0-9]+/gi, ''); if(mob){ open('https://wa.me/'+mob+'?text='+encodeURIComponent(demotext), '_top'); } } 3. Adding the macro to the dictionary of the concerned field.

Labels:

View original source

https://www.servicenow.com/community/developer-blog/servicenow-integration-with-whatsapp/ba-p/2333157