Skip to main content

I am using a ZAP to import responses to a Facebook form to a SQL Database. Unfortunately users are from time to time adding an emoji to their response which causes this error on Zapier. 

It seems Zapiers solution is to create a FORMATTER and replace text to change the emoji characters to something else but this is not practical as there are 100’s of different emoji a user could use. 

Are there any suggestions to just strip out all UNICODE characters rather?

@woodzza 

There are a couple of approaches you can use to get your text into ASCII. The easiest is to use the text formatter to convert to ASCII which will replace all non-ASCII characters. Configuration would be as below.

 

 

The other would be to use a code block, especially if I need to manipulate the data. Python is my preferred language, so I would do something like below.  

 

import re

user_response = input_datap'user_response']

# Strip non-ASCII characters using regex
cleaned_response = re.sub(r'e^\x00-\x7F]+', '', user_response)


return {'Cleaned Text': cleaned_response}

 

Hope this helps.


thanks ​@Badger , this does help give a bit of direction - almost. What I cant see is how to apply this to multiple fields; it seems to allow me to select multiple inputs but then they get combined into a single output as opposed to just having those values updates before being passed to the next step (SQL SERVER).

 


@woodzza 

You may need one formatter for each field rather than combining them. 

My understanding is that formatters these don’t cost you tasks, so having multiple ones is just a case of working your way through the what needs changing and then adding to your SQL Step.

Renaming them is a good idea as it makes it easier to workout which one you’re grabbing data from. 

I noticed you’re using a legacy version of the SQL Server. You may wish to consider updating to the latest version. 


Thanks so much for marking Badger’s reply as the best answer here ​@woodzza! Really pleased they were able to help get things sorted—and thanks for helping out here, ​@Badger! 🤗 

If there’s anything else you need please do reach back out to the Community again. In the meantime, happy Zapping! ⚡️


Reply