0

Zapier referred me here as they have limited support. I'm looking to remove all emoji from a text string.

We have a Facebook ad campaign where users fill out a text form. Form submissions go into Zapier so it can do some automatic processing downstream. Occasionally users enter a bunch of emojis after their name. I'd like to keep their name but purge emojis.

Looking at Zapier's logs these submissions look like the below.

Bob = Bob\ud83d\udcaf\ud83d\udcb8\ud83d\udcb0\ud83d\udcb5

Thoughts?

1 Answers1

0

I'd use Python (via Code by Zapier) to remove those characters from the string.

There are other answers that will point to this. The simplest I found was at this answer:

def deEmojify(inputString):
    return inputString.encode('ascii', 'ignore').decode('ascii')

return {'cleaned': deEmojify(input_data['name'])} # <- you need to map that field into the code step
xavdid
  • 5,092
  • 3
  • 20
  • 32
  • Thank you xavdid! If I'm reading this right I would just replace 'name' in that last part with my actual field name? – guyinanoffice Mar 06 '20 at 18:10
  • Sort of! when setting up a code step, you'll map values from earlier steps into the code step (which is then made available in `input_data`). So here, `'name'` is whatever the name of the variable is (separate from your actual field name). – xavdid Mar 06 '20 at 22:38