cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

how to add an international dialling code Dropdown List embedded within a Phone Number Type Field

Hi, 

 

I would like to use in my Entity Main Form a Phone Number Type Field where you can select an international dialling code ?

 

How can I do that ?

 

Thanks,

 

Arioule

2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution Sage
Solution Sage

To do that you will need to create a PCF component as that would be the only way of using a drop down alongside the phone number textbox within an existing field.

 

While there isn't a PCF component that does exactly what you want https://pcf.gallery/phone-number-by-country/ adds a the country flag using the country code (which may help) https://pcf.gallery/check-phone-number-control/ will validate the number is correct for that country.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

@Arioule if your requirements are a little flexible I would try to leverage out-of-the-box options rather going via the customizations route like PCF. If you can't have a separate optionset field, then you can easily format to phone and enforce a international code with the Input Mask control. Here are the quick steps:

  1. Open your solution that contains that entity and open the main form. Click the "switch to classic" button on the top
  2. Select the phone number field and click "Change Properties"
  3. Navigate to the Controls tab and click on "Add Control"
  4. Select "Input Mask" and click add
  5. Pick you field for the Field property
  6. Enter the desired mask (e.g. 00-000-0000) for the Mask property.
  7. Ensure the Input Mask control is selected for Web, Phone and Tablet.
  8. Save all and publish all customization
    2020-06-20_10-09-00.png

 

View solution in original post

6 REPLIES 6
Super User II
Super User II

Hi @Arioule, do you want to select an international dialing code from another field like an optionset (dropdown) or you would like to validate your current phone number field to have the international dialing code? Thanks

Solution Sage
Solution Sage

To do that you will need to create a PCF component as that would be the only way of using a drop down alongside the phone number textbox within an existing field.

 

While there isn't a PCF component that does exactly what you want https://pcf.gallery/phone-number-by-country/ adds a the country flag using the country code (which may help) https://pcf.gallery/check-phone-number-control/ will validate the number is correct for that country.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

@Arioule if your requirements are a little flexible I would try to leverage out-of-the-box options rather going via the customizations route like PCF. If you can't have a separate optionset field, then you can easily format to phone and enforce a international code with the Input Mask control. Here are the quick steps:

  1. Open your solution that contains that entity and open the main form. Click the "switch to classic" button on the top
  2. Select the phone number field and click "Change Properties"
  3. Navigate to the Controls tab and click on "Add Control"
  4. Select "Input Mask" and click add
  5. Pick you field for the Field property
  6. Enter the desired mask (e.g. 00-000-0000) for the Mask property.
  7. Ensure the Input Mask control is selected for Web, Phone and Tablet.
  8. Save all and publish all customization
    2020-06-20_10-09-00.png

 

View solution in original post

@EricRegnier How do you use an input mask when phone number lengths and formats differ across countries - for instance the US has a 3 digit area code, the UK has 3 or 4 digit area codes depending on the area.

 

That was why I suggested PCF components as this is a problem where a mask will instantly fail once you leave the USA and equally a solution that was been fixed by various Javascript libraries over the past 20+ years. 

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Hi @ben-thompson,

 

Thanks a lot

Hi @EricRegnier,

 

Thanks a lot.

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (30,799)