cancel
Showing results for 
Search instead for 
Did you mean: 

Add starting zero to 5 digit numbers (when 6 digits are necessary)

Gerard_Spijker
Enthusiast

Dear community, I am looking for a formula to enforce for a field that six digits are in a field. When there are 5 digits, then a zero gets added at the front. 

Thanks!

1 REPLY 1

AnthonyValidity
Validity Team Member
Validity Team Member

Hi @Gerard_Spijker ,

Thank you for reaching out via the Validity Customer Community.  This could be accomplished in the Modify module using the Modify Action "Formula".

Here is an example using the Account Object and modifying the Billing Zip Code.  You would replace the fields names in this formula with the field you're using.

 

 

IF(LEN(${BillingPostalCode})=5, "0" & ${BillingPostalCode}, ${BillingPostalCode})

 

 

AnthonyValidity_0-1741186657394.png

 

  • IF(condition, value_if_true, value_if_false) - This is using an IF statement to make a decision based on a condition.
  • LEN(${BillingPostalCode})=5 - The condition checks if the length of the billing postal code is exactly 5 characters.
  • If the postal code is exactly 5 characters long, it adds a "0" in front of it: "0" & ${BillingPostalCode}
  • If the postal code is NOT 5 characters long, it just uses the postal code as is: ${BillingPostalCode}

Best,

Anthony Lardiere Jr

Sr. Customer Success Manager

Validity