function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Majid AghaieMajid Aghaie 

Process Builder country code Duplicate - Need Help !

Hi all, thanks if advance for your help. I want the phone field to be populated with the country code so I created a flow with process builder that inserts the country code of a selected country in the phone field. The problem I am having now is: when a user manually inserts the country code - on saving the record, process buuilder still populates the phone field with the country code resultig to a duplicate of country code.

Can someone please help with a solution. 
Palani_ChinnasamyPalani_Chinnasamy
Hi Majid Aghaie,
In the Field update formula, check like, IF(BEGINS (Phone, countrycode), "", "countrycode"). If the Phone number starts with Countrycode, do not add it, If the phone numbre not start with country code add it.

I hope it will help you, If it not, let us know the process builder formula for the Phone number update, which you have used.
Majid AghaieMajid Aghaie
Hi Palnai
Thank you for the quick reply. I have tried the solution but it does not work well. I think it needs to be improved.

From yours I did::  IF(BEGINS ([Account].Phone, "+1"), "", "+1" &' '& [Account].Phone)

Now the problem is if I add a phone number to the country country code example ("+15557773399" or "0015557773399") to the field, the field turns out blank on saving it.

Any solution please....
 
Palani_ChinnasamyPalani_Chinnasamy
Please modify as follows,
IF(BEGINS ([Account].Phone, "+1"), [Account].Phone, "+1" &' '& [Account].Phone)
 
Majid AghaieMajid Aghaie
IF(BEGINS ([Account].Phone, "+1"), [Account].Phone, "+1" &' '& [Account].Phone)

I have done a test with this 0015557773399 
This works but it still adds the country code of "+1" so, the final number received is :::  +1 0015557773399  

Now this is not correct.