When using Microsoft’s Omnichannel for Customer Service you may need to ensure phone numbers held on your accounts and contacts are in a specific format. In this post I will explain why and how I validate my numbers.

There are several times when the phone number format may be significant. I will list a few examples below.

Outbound Calls
Below you can see I have entered a phone number in the incorrect format on one of my accounts.

Below you can see that if an agent tried to use the phone icon to commence an outbound call, they will see and error about the phone number being invalid.

To support outbound calling the phone number will need to include the country code. I’m in the UK, so we use the “44” country code. Meaning for the number to be valid, I’d need to enter the number as “+447767207939” or “447767207939”. (You will want “+447767207939”! I will explain why in a second!)

Inbound

Another reason the phone number format is significant relates to inbound calls. As when a call starts a search will be completed to try and match to a suitable contact to account.

Below you can see I have an incoming call. In the conversation details section, we can see the incoming phone number. Notice that that format includes a “+” and the country code. As the total string will be used, we’ll want to include the “+” in any phone number fields on our accounts and contact. (Or they will not be automatically linked to the incoming conversation.)

The Challenge!
Within Dynamics 365 (as I’m sure you know) we have phone number fields on our contacts and accounts. But out of the box no validation is applied to these fields.

To demonstrate this, I have entered a number against my account which is obviously not valid!

Solution
This means you will probably need to consider adding some form of validation to your phone number fields. I guess there will probably be many ways to achieve this. As an example I will show how I’ve added JavaScript to my contact form to validate numbers.

Note: I’m not a dev! Please don’t shoot me if my JavaScript isn’t the best in the world. I’m not trying to show off my coding skills … instead I’m just showing the concept of how you might address this challenge.

Below you can see the result of a change I’ve made to my contact form. If a number is enter using an invalid format an error will be given. Additionally, if the user forgets to add the “+” symbol it will be added for them. And as I’m in the UK, if no country code is enter I’ll default it to “+44”. (You could obviously use a different default.)

My “solution” is simple enough. I am simply triggering some JavaScript on change of my mobile phone or business phone fields.

FYI … I also trigger the same logic when my form loads. As that way I also validate numbers entered before I enforced the correct phone number formats.

Should you wish to clone (or ideally improve) my JavaScript I have shown my code below.

Hopefully this post has explained why the phone number format is significant. And given you a few clues on how to enforce compliance with the required format. Enjoy.

I previously created a few posts that relate to this topic. You may find reviewing them useful!

Leave a comment

Trending

Website Powered by WordPress.com.