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
Claire NicolayClaire Nicolay 

WF rule & field update for phone in format 11 11 11 11 11

Hi, can somebody help with a WF rule and field update that would ensure that the phone number shows up as above?
many thanks in advance, claire
Best Answer chosen by Claire Nicolay
Akhil AnilAkhil Anil
Hi Claire,

Rather than having a workflow update the phone number to a specific pattern, I suggest that you put a validation rule so that the users enter it in the required format.

So you need to build a validation rule with a formula like this
 
NOT(REGEX(Phone, "[0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2}"))

This will throw an error if the pattern is not followed while the users enter the phone number.

This will make it easier than building a worklfow field update to follow a specific pattern.

Hope that helps !

All Answers

Rowallim TechnologyRowallim Technology
Hi Claire
 You can use Regex function in workflow to get that phone number pattern.
Hope it will help you.
Please mark best answer if it helps.
Regards 
Claire NicolayClaire Nicolay
Hi,I have tried but it does not work ... can you help? Many thanks
Rowallim TechnologyRowallim Technology
Hi Claire
Use this regex formula" REGEX(Phone, " [0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2}")" .
Hope this will help you.
Please mark best answer if it helps.
Regards
 
Claire NicolayClaire Nicolay
this is exactly what I have used but I get an error message saying expected content is booleen ....
Apoorv Saxena 4Apoorv Saxena 4
Hi Claire :

Try using this formula  in your workflow field update action :

MID(TEXT(VALUE(Phone)),1,2)
+' '+MID(TEXT(VALUE(Phone)),3,2)
+' '+MID(TEXT(VALUE(Phone)),5,2)
+' '+MID(TEXT(VALUE(Phone)),7,2)
+' '+MID(TEXT(VALUE(Phone)),9,2)

Hope this helps!

Please let me know how this works for you, mark this as Solved if this helps you so that others can view it as a proper solution.

Thanks,
​Apoorv
Akhil AnilAkhil Anil
Hi Claire,

Rather than having a workflow update the phone number to a specific pattern, I suggest that you put a validation rule so that the users enter it in the required format.

So you need to build a validation rule with a formula like this
 
NOT(REGEX(Phone, "[0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2}"))

This will throw an error if the pattern is not followed while the users enter the phone number.

This will make it easier than building a worklfow field update to follow a specific pattern.

Hope that helps !
This was selected as the best answer