Help

Re: UTM formula hyperlink is not working

Solved
Jump to Solution
2238 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Harmony_Gilliar
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello, I have a formula for UTM and its pulling from the other columns in the sheet, but for some reason, it is not hyperlinking the entire URL. I not sure why, But I have doubled checked the formula to make sure there are no spaces. I am new to Airtable formulas so I am not sure what I am doing wrong. Thanks!

15 Replies 15

@Zollie Typing is not too hard but rather time-consuming as I have been trying to fix this problem for about a week, with no solution. I am sure you could imagine how frustrating that is, especially on a tight deadline. Heres a read-only link : https://airtable.com/shr4GMQjgVpjd968A

let me know if it works. Thanks.

Yes that can be frustrating. Sorry if my remark came off as flippant. The shared view helped a great deal.

The additional space characters are being introduced from multiple places:

(1) The formula itself

Whoever wrote it left some spaces in some of the strings (a string is anything with quotes around it). I’m not sure if those were intentional or not, but here it is without those additional spaces:

LOWER( {URL} & "?utm_medium=" & {Medium} & "&utm_source=" & {Source} & "&utm_campaign=" & {Campaign Name} & "utm_content=" & {Content})

(2) Single select fields that the formula relies on

Both “Source” and “Medium” have space characters added to some of the values - for example, “twitter” is "twitter ". There could be other fields with the same issue.

You could either keep a closer eye on any fields that the formula relies on, or build your formula to correct for user error. To remove spaces, you’d use TRIM, which removes leading or trailing space characters, or you could use a function like SUBSTITUTE to automatically replace any space characters with a hyphen (as you have with the “Campaign Name” field).

Examples:

TRIM({Source})
"Twitter " => “Twitter”

SUBSTITUTE({Content}, " ", “-”)
“Post With Image” => “Post-With-Image”

Putting it all together, you’d end up with this:

SUBSTITUTE( LOWER( TRIM({URL}) & "?utm_medium=" & TRIM({Medium}) & "&utm_source=" & TRIM({Source}) & "&utm_campaign=" & TRIM({Campaign Name}) & "utm_content=" & TRIM({Content}) )," ","-")

Harmony_Gilliar
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you @Zollie this is very helpful and informative I really appreciate it! I hate to be a bother but it’s still not working it’s telling me the formula is invalid which is strange. I am really not used to Airtable formulas. Heres what I am seeing :
Screen Shot 2020-04-22 at 4.31.38 PM

It’s working on this copy of the base you posted. I’ll keep that base up for a week so you have time to duplicate it and poke around.

Here it is again in case a typo was introduced:

SUBSTITUTE( LOWER( TRIM({URL}) & "?utm_medium=" & TRIM({Medium}) & "&utm_source=" & TRIM({Source}) & "&utm_campaign=" & TRIM({Campaign Name}) & "utm_content=" & TRIM({Content}) )," ","-")

But every now and then I have to write a formula by hand to get Airtable to recognize some of the field values.

Best of luck!

It looks like there are a lot of curly quotes “ ” in your screen captures. Change all of them to straight quotes " .

This is a very common issue when copy/pasting formulas from the community.

Thank you its working now! @Zollie I really appreciate all of your help