UTM Builder If Blank Formula

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?

Welcome to the community, @Megan_Kenley! :smiley: 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))
1 Like

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.