Mobile App Academy: Redirecting Mobile Agent users to the Now Mobile client – July 5, 2022
Scripts referenced in the video:
1. Scripted Data Item (returns media section records matching the Content Viewers value 'Employees accessing Agent' if users have no role assigned)
(function getQueryString(input) { //This script will return no rows if the user has roles, but will return a static media section row if the user is an employee and has no roles var queryString = ''; var grCheck = new GlideRecord('sys_user_has_role'); grCheck.addEncodedQuery('role!=7fcaa702933002009c8579b4f47ffbdeuserDYNAMIC90d1921e5f510100a9ad2572f2b477festate=active'); grCheck.query(); if (grCheck.hasNext()) { queryString += "sys_id=-1"; } else { queryString += 'content_viewers=Employees accessing Agentvisibility=true'; } queryString += "ORDERBYorder"; return queryString;
})(input);
2. System Property required to allow URL based redirection to another app (comma delimited string):
Name: glide.sg.allowed_external_deeplinks
Value: snrequest
3. Service Portal Widget client controller (for App store redirection):
https://www.servicenow.com/community/mobile-apps-platform-articles/mobile-app-academy-redirecting-mobile-agent-users-to-the-now/ta-p/2301498