Tips, Tricks & Best Practices

FotisGonidis
Member

Can I add If and elseIf statements in calculated property?

SOLVE

I want to create a new calculated property "new_prop" that gets the value based on the following logic:

 

if( forecast_probability > 80){

new_prop = A}

else if( 80> forecast_probability >50 ){

new_prop = B}

else if (50> forecast_probability){

new_prop = C}

 

I managed to use an If statement but I cant find how to use "else if". Any ideas?

0 Upvotes
1 Accepted solution
Josh
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Can I add If and elseIf statements in calculated property?

SOLVE

Hi @FotisGonidis,

 

There are quite a few discussions on around similar in the community. It does seem that people have challenges around this, but I think this might be the most related discussion:

https://community.hubspot.com/t5/CRM/Custom-calculation-property-field-IF-logic-not-working/m-p/9364...

 

Check out @RiccardoPisani's response as it might be helpful. I realize you don't have a "null" in your logic, but you do have if variables similar to the example. Note, "else if" is not an option in the custom formula, but you can still have nested if statements.

 

I hope this points you in the right direction.

 

Josh 




Did this post help solve your problem? If so, please mark it as a solution.

Josh Curcio

HubSpot support and inbound marketing for OEMs, contract manufacturers, and industrial suppliers.
HubSpot Diamond Partner & HubSpot Certified Trainer

View solution in original post

0 Upvotes
1 Reply 1
Josh
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Can I add If and elseIf statements in calculated property?

SOLVE

Hi @FotisGonidis,

 

There are quite a few discussions on around similar in the community. It does seem that people have challenges around this, but I think this might be the most related discussion:

https://community.hubspot.com/t5/CRM/Custom-calculation-property-field-IF-logic-not-working/m-p/9364...

 

Check out @RiccardoPisani's response as it might be helpful. I realize you don't have a "null" in your logic, but you do have if variables similar to the example. Note, "else if" is not an option in the custom formula, but you can still have nested if statements.

 

I hope this points you in the right direction.

 

Josh 




Did this post help solve your problem? If so, please mark it as a solution.

Josh Curcio

HubSpot support and inbound marketing for OEMs, contract manufacturers, and industrial suppliers.
HubSpot Diamond Partner & HubSpot Certified Trainer

0 Upvotes