cancel
Showing results for 
Search instead for 
Did you mean: 

UK deduping

SheilaP
Observer

Hi, does anybody have any suggestions for finding UK postcodes which are incorrectly formatted?  Usually no space in the correct place.  Also how to fix this.  Thank you

3 REPLIES 3

AnthonyValidity
Validity Team Member
Validity Team Member

Hi @SheilaP !

There's probably different RegEx formulas you could use for this, but I found one that worked great in my demo environment.  There's another for the special UK addresses but unsure if those apply to you.  When you use Modify, you're going to use the Formula action.  The formula / function is called RegExMatch and you're going to enter the following formula but the ${BillingPostalCode} would change depending on what field you're using:

RegExMatch( ${BillingPostalCode} , "^[A-Z]{1,2}[0-9][A-Z0-9]? ?[0-9][A-Z]{2}$") 

AnthonyValidity_0-1677604575076.png

The other formula, which is much more complicated, accounts for "special cases." 

RegExMatch( ${BillingPostalCode} , "^(([A-Z]{1,2}[0-9][A-Z0-9]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?[0-9][A-Z]{2}|BFPO ?[0-9]{1,4}|(KY[0-9]|MSR|VG|AI)[ -]?[0-9]{4}|[A-Z]{2} ?[0-9]{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$") 

I cannot think of a way to fix these automatically.  The above formulas will identify those fields that are not structured properly.  You would then edit them manually right while you in the Dedupe preview screen or export the grid with the record IDs, fix the flagged records, and then update them using Import.

Hope this helps!

Anthony Lardiere Jr
Customer Success Manager

Dear Anthony, thank you for looking at this issue.  I tried both formula but couldn't get it to work or bring up any errors.  Kind regards, Sheila

Hi @SheilaP ,

Sorry to hear it is not working for you!  I am able to test in my environment and it is working so we may need Support to take a look with you.  You can click here to open a ticket.

I think it would help them if you take screenshots of your entire scenario from step 1 to the very end.

Anthony Lardiere Jr
Customer Success Manager