Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here
Sep 14, 2020 12:19 PM
I am building a UTM builder in airtable. Everything is working except there is one field where we do not always need a value. when I leave it blank the end of my URL has “_content=”. I’d like to have a formula that removes that last part of the URL when that value is not present. Does anyone know how to program that?
Sep 14, 2020 08:41 PM
Welcome to the community, @Megan_Kenley! :grinning_face_with_big_eyes: Instead of removing it after it’s added, I suggest modifying the system you’re using to build the URL so that the optional piece is never added if that related field is empty. That can be done with a simple IF()
function around that part, like the example below. This is just the end of a longer formula, and I’m using the field name {Content}
to represent your optional content field. I’m also wrapping the contents of the {Content}
field in the ENCODE_URL_COMPONENT()
function, as all content passed via URL should be encoded:
... & IF(Content, "&content=" & ENCODE_URL_COMPONENT(Content))