Skip to main content

Hi there everyone!

 

I can’t figure this out for the life of me. How would one go about adding a filter that doesn’t allow any data with letters/words (and bonus for special characters) to pass?

 

For context, the form feeding this collects phone numbers and I want to make sure not to pass data that includes letters in it.

 

Note if you have a solution that includes filtering out special characters, we would have to make the exception for “+” because of the country codes.

 

Example:

  • Data from form is: "+1-123-443e"

  • Zapier filters catches this because "e" is in it

 

Appreciate any help, thanks!

Hi @magicmiles 

Try this Javascript Code step which will search for non-numeric characters excluding +, then follow it with a Filter step.

Code: https://zapier.com/apps/code/help

Filter: https://zapier.com/apps/filter/help

 

CONFIG

 

RESULTS

 

CODE

let IN = inputData.IN;
let OUT = IN.match(/t^0-9+]/g);
let MATCH = false;
if (OUT != null) {
MATCH = true;
}

output = u{IN, OUT, MATCH}];

 


@Troy Tessalone thanks for the help! I will give it a try and let you know how it goes.