Identify the use of Emoji in a text field

I have an email tracking app built in Bubble.

I have set up a webhook that sends me the subject, body, sender information, date, etc for each new email a brand sends to my email.

Now I have a yes/no filed in my database for subjects with emoji. So, Is there a way to identify a subject line (text field) containing emoji? If yes, it should change the field to yes or else no.

Additionally, what could be the easiest way to store different emojis in my database so that I can then show the most commonly used emoji by a brand in UI?

Let me know if I am not able to communicate my problem clearly.

Your any input will be very helpful.

Emojis would be stored in the database as a text field.

What do these values look like when returned from the webhook?

These are simple texts. Example - Run, your travel freebies are leaving :v:

Share a screen shot of the actual returned values from the api call (such as the raw data seen when you first initialize the call) for the raw data as often times emojis might be sent with some sort of code applied to it.

You can do this using Regex because the Unicode Consortium has practically converted everything into Unicode. You can find the references for each emoji on their website. For example, U+1F600 corresponds to :grinning:.

The regex code most accepted by the community for this use case is: <:[^:\s]+:\d+>|<a:[^:\s]+:\d+>|(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]|\ufe0f)

In Bubble, it would look something like this:

In this case, you should not insert :formatted as text if you want to save it as yes/no in the database; I only did that for visual appeal. It will automatically save as yes if there are 1 or more emojis.

So, each time the Regex finds 1 or more emojis, it will return a yes:

WITHOUT EMOJIS
image

WITH EMOJIS
image

I assume you want to extract emojis from emails and display the most used ones… Here’s a total guess since I can’t test it: I believe you can do this by creating a new data type called Emojis and within that type, create a text field called Emoji. Then, for each emoji returned by the extract with regex function, create a new entry in the database. To display the most used emojis on the user interface, group by emojis and show the count.

Hi Arthur,

Thanks a ton. The first solution worked perfectly to identify the use of emoji.

Regarding, displaying the most used emojis, I have a created a data type called with field emoji (text field), and email (reference to email data type).

Now I am not able to figure out how will i create a separate entry for different emoji. Any idea how i will extract the emoji with similar regex function and create separate entry for each emoji?

Hi,

Are you on a paid plan? You can create a list of things by following this: Create a list of things

Then, just set the Regex again that will create a new line in the DB for each emoji.

Hi Arthur,

I don’t see an option to create a list of things. I am on a paid plan. Am i missing something?

This topic was automatically closed after 70 days. New replies are no longer allowed.