You need to sign in to do that
Don't have an account?

Regex usage in formula field
Hi All,
I'm currently trying to use a REGEX operator in a formula field. This is my code :
IF(
OR(
REGEX((SUBSTITUTE(Contact_Phone__c," ","")), "[0-9]{12}"),
REGEX((SUBSTITUTE(Contact_Phone__c," ","")), "[0-9]{11}")
),
SUBSTITUTE(Contact_Phone__c," ",""),
""
)
This is the error I get : Function REGEX may not be used in this type of formula (Related field: Formula)
But on the documentation page (https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=5) it seems like I can use REGEX in a formula field.
Many thanks for any explanation !
I'm currently trying to use a REGEX operator in a formula field. This is my code :
IF(
OR(
REGEX((SUBSTITUTE(Contact_Phone__c," ","")), "[0-9]{12}"),
REGEX((SUBSTITUTE(Contact_Phone__c," ","")), "[0-9]{11}")
),
SUBSTITUTE(Contact_Phone__c," ",""),
""
)
This is the error I get : Function REGEX may not be used in this type of formula (Related field: Formula)
But on the documentation page (https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=5) it seems like I can use REGEX in a formula field.
Many thanks for any explanation !
REGEX: This function is available everywhere formulas exist except formula fields and custom buttons and links.
https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=5
... almost everywhere.
You can use a validation rule with regex.
All Answers
REGEX: This function is available everywhere formulas exist except formula fields and custom buttons and links.
https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=5
... almost everywhere.
You can use a validation rule with regex.
HOW TO CREATE A REGEX TO MAKE A VALIDATION RULE THAT THE FIRST LETTER OF THE FIELD ENTRY SHOULD BE A CAPITAL LETTER.