Best answer

How can I filter out special characters in multiple fields using Zapier for CRM data upload?

  • 7 November 2023
  • 3 replies
  • 498 views

Userlevel 1

Hello,

I have a form that collects a series of notes which is then passed to Zapier to upload to our CRM via an API. This works well until the notes contain certain characters such as “ / *.

The notes are broken down into multiple fields, eg. General Notes, Exercise Notes, Strategy Notes, etc...

Is it possible to have zapier filter multiple fields for these characters or do I have to use a find/replace formatter for each one.

Appreciate any help and happy to provide further details if needed.

icon

Best answer by GetUWired 7 November 2023, 14:36

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +12

@JamesDW 

You could use a Zapier code block, this example is JavaScript.  The code uses regular expressions to remove special characters from a text string.  Modify the regex string to fit your needs.

 

// Input Data

const bodyTxt = inputData.bodyTxt;

// bodyTxt contains "Hello / what are * you doing? .. What .."

 

//Regular expression to remove special characters (excluding spaces)

let regex = /[^a-zA-Z0-9\s]/g;

let modTxt = bodyTxt.replace(regex, '');

 

output = [{bodyTxt: bodyTxt, modTxt: modTxt}];

 

bodyTxt

Hello / what are * you doing? .. What ..

modTxt

Hello what are you doing What

 

Zap Support

GetUWIred

Userlevel 1

Brilliant, thank you very much!

Userlevel 7
Badge +11

That’s fantastic news @JamesDW! 🎉 Thanks so much for circling back to confirm that did the trick. And big thanks to @GetUWired for that awesome suggestion of using a Code by Zapier action for this! 🙌

Please do reach back out in Community again if you need any further help at all. In the meantime, happy Zapping! ⚡