Skip to main content

We’re a film festival looking to pull the titles of our submissions in order to create slugs that can be used to create virtual posts on our WordPress site.


I need a way to parse just the text from the submission, with the ability to remove special characters (i.e. " ’ ! ? ; : @ # $ % ^ etc.).


I’ve gotten to this point so far:


LOWER(SUBSTITUTE({English Title}, " ", "-"))

This allows me to hyphenate the titles, but still includes special characters. Is anyone aware of a workaround for this, or do I need to manually create my slugs in this case?


Cheers!

Reading through URL encoders this morning - building formulas to parse urls so that I can easily construct associated MS Flows.




Does anyone have a more elegant method of doing this? Would be great if Airtable had additional formulas for this. Another that I’ve always wanted is Base64 encode/decode.


REGEX_REPLACE(
REGEX_REPLACE(
REGEX_REPLACE({URL},
"%2F", "/"),
"%20", " "),
"%5F", "_")

It sounds like you want the exact opposite of the ENCODE_URL_COMPONENT() function. Right now your method—or a similar one using SUBSTITUTE()—is the only available option.


It sounds like you want the exact opposite of the ENCODE_URL_COMPONENT() function. Right now your method—or a similar one using SUBSTITUTE()—is the only available option.


Yup, I thought that might be the case. Thanks for confirming - and fingers crossed we can see some more formula love this year.


I found this formula at the following link:
https://docs.whalesync.com/resources/support/how-to-create-a-slug-field-in-airtable

LOWER(REGEX_REPLACE(REGEX_REPLACE(REGEX_REPLACE(TRIM({Name}), "[^a-zA-Z0-9- ]", ""), " ", "-"), "-+", "-") & "-" & RIGHT(RECORD_ID(), 5))

I modified it:
LOWER(REGEX_REPLACE(REGEX_REPLACE(REGEX_REPLACE(TRIM({Name}), "[^a-zA-Z0-9- ]", ""), " ", "-"), "-+", "-"))

Then using Airtable's AI I modified the formula and added the accent substitution:

LOWER(REGEX_REPLACE(REGEX_REPLACE(REGEX_REPLACE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM({Name}), "Á", "A"), "É", "E"), "Í", "I"), "Ó", "O"), "Ú", "U"), "á", "a"), "é", "e"), "í", "i"), "ó", "o"), "ú", "u"), "n^a-zA-Z0-9- ]", ""), " ", "-"), "-+", "-"))

Reply