Account linking in pre-built messaging integrations
Summarize
Summary of Account Linking in Pre-built Messaging Integrations
Account linking in Virtual Agent allows users of supported messaging applications to connect their profiles to ServiceNow. This integration facilitates automatic access to Virtual Agent topics related to ServiceNow records through account auto-linking, enhancing user experience by minimizing the need for manual linkages.
Show less
Key Features
- Account Auto-linking: This feature automatically links users' messaging accounts to their ServiceNow profiles if they use the same email address for both accounts. Users are not prompted to link their accounts, streamlining the engagement process.
- Logout Command: Users can unlink their accounts during conversations using a logout command, but they will then be prompted to link their accounts again in future interactions.
- Configuration Options: Administrators can enable account auto-linking in the Messaging Apps Integration settings by selecting the appropriate connection record and configuring the necessary fields.
Key Outcomes
By enabling account auto-linking, ServiceNow customers can expect improved user engagement with the Virtual Agent, as users can seamlessly access their ServiceNow records without manual account linking. This feature is particularly beneficial for organizations using Microsoft Teams, as it requires installation under a global domain for cross-domain linking.
In Virtual Agent, account linking maps the users of a supported chat or messaging application to their ServiceNow user profile. Account auto-linking authenticates your messaging users, which enables users to automatically access Virtual Agent topics that involve ServiceNow records. If needed, users can also manually unlink from or link to their ServiceNow accounts.
How account auto-linking works
In the Conversational Integrations for Slack, Microsoft Teams, and Workplace from Facebook, you have the option to enable account auto-linking, which automatically links messaging users to their ServiceNow accounts. If you enable the account auto-linking feature on the Messaging Apps Integration page, your users are not prompted to link to their ServiceNow accounts when they engage with the virtual agent.
In earlier releases, messaging users were prompted to link to their ServiceNow accounts or continue as guests. However, for the Conversational Integrations for Slack, Microsoft Teams, and Workplace, if you enable account auto-linking, your users do not manually link their messaging accounts to their ServiceNow accounts, provided that they use the same email account for their messaging and ServiceNow accounts. During auto-linking, Virtual Agent maps the email accounts of messaging users to their email accounts defined in their profiles in the Users [sys_user] table. When the email accounts match, the user is automatically linked (authenticated) and they do not see the Link to ServiceNow button when they begin a bot conversation.
In messaging integrations, your users can still use the logout command during bot conversations to unlink from their ServiceNow accounts. However, in all subsequent conversations after unlinking, Virtual Agent prompts them to link their accounts. When they engage with the virtual agent, they are prompted to link to their ServiceNow account or continue as a guest user.
Account auto-linking
You can allow a user's 3rd party accounts to be auto-linked to their ServiceNow® profile.
In the navigation filter type sys_cs_provider.list. Select the connection record you wish to link. Check the Allow account linking box, then check the Auto link users' ServiceNow profiles box that appears. Fill in the Automatic link action field with the corresponding account linking script.
var response_body = inputs['response_body'];
var status_code = inputs ['status_code'];
var email_id = '';
if(status_code>200 && status_code<=210){
email_id = response_body && JSON.parse(response_body).userPrincipalName;
}
var sysUserId = null;
if(email_id){
var gr = new GlideRecord("sys_user");
gr.addQuery("email",email_id);
gr.query();
while(gr.next()){
sysUserId = gr.getUniqueValue();
}
}
if(sysUserId){
outputs['status'} = 'Success';
outputs['userid'] = sysUserId;
}
else{
outputs['status'] = 'Failure';
}
})(inputs,outputs);