Help with a nested if calculated field/property

Need some help with a formula. I feel like I’m missing something really simple?

These are my conditions:

  1. if [properties.hs_analytics_first_referrer] contains linkedin, then label it LinkedIn Ad
  2. if [properties.hs_analytics_source] is Paid search, then label it Google Ad
  3. if [properties.hs_google_click_id] is populated AND [properties.hs_analytics_first_referrer] contains goog, then label it Google Ad

This is the calulcation I’m using:

if(contains([properties.hs_analytics_first_referrer], "linkedin"), "LinkedIn Ad",

if([properties.hs_analytics_source]="PAID_SEARCH", "Google Ad", 

if(is_known([properties.hs_google_click_id]) and 
 contains([properties.hs_analytics_first_referrer], "goog"), "Google Ad", 

 "N/A")))

1st one tests fine & so does the 2nd. The 3rd option never gets calculated, no matter how many times I reorder them. 1 & 2 always test find. the 3rd condition never tests well, no matter which condition is.

tests as listed above

test w/ linkedin moved to the top, now works & the now 3rd paid search one then doesn’t.

Am I trying to do “Team Too Much” and nesting like this is not possible?

Tagging @karstenkoehler as I’ve seen them able to help others before. :grin:

Hi @esteeratliff !

As far as I understand you are trying give a property a value based on existing value, is that correct? I think the best way to achieve this (and easiest) is through a workflow.

You can trigger by the conditions you are setting and branch it after that you can set an action to change property value to the desired one.
Hope that helps!

If you need further assistance I offer free support here: https://meetings-eu1.hubspot.com/carolina10/hubspot-consultancy

Carolina De Mares

Brandgang

Goirkekanaaldijk 14

5046 AT Tilburg

That’s a good idea. Instead of forcing the field to work, I can just populate my field via workflow. Thank you for the sanity check! :sweat_smile: