Tips, Tricks & Best Practices

BGreen92
Participant

Custom Property Calculation with a Condition

SOLVE

Hello, 

 

I have been implementing a property onto deals that calculate the number of days the deal has been in a deal stage. 

 

I'm using a custom formula on a property: 

time_between([properties.date_became_sales_qualified_lead_in_pipeline],[properties.todays_date])

 

I need to add a condition to this to stop the property from updating when it exits the Sales Qualified Lead Stage. At the moment, it continues to count. 

 

Thank you

0 Upvotes
1 Accepted solution
BGreen92
Solution
Participant

Custom Property Calculation with a Condition

SOLVE

Thank you, Colin; I have managed to get this to work. I'll post the solution for others just in case they need to achieve a similar scenario. 

 

Here's the code that I have used to auto-update a property on a deal, telling me how many days the deal sat in that stage. 

if(([properties.dealstage] == "1234567"), time_between([properties.date_became_pql],[properties.todays_date]), if((((([properties.dealstage] == "1234568") || ([properties.dealstage] == "12345689")) || ([properties.dealstage] == "12345690")) || ([properties.dealstage] == "12345691")),time_between([properties.date_became_pql],[properties.hs_date_deal_exited_stage])))

View solution in original post

2 Replies 2
colinwitt
Top Contributor | Gold Partner
Top Contributor | Gold Partner

Custom Property Calculation with a Condition

SOLVE

Hey @BGreen92,
maybe you could try to add an if-condition to your formula. Something like this: 

if([properties.lifecyclestage]="salesqualifiedlead")

 

But I'm not sure if that fully works as the calculated properties always continue to calculate. Another option might be to extract the calculated value into another static property at a time where it's correct (with a "copy property value" workflow action).

Best regards
Colin

BGreen92
Solution
Participant

Custom Property Calculation with a Condition

SOLVE

Thank you, Colin; I have managed to get this to work. I'll post the solution for others just in case they need to achieve a similar scenario. 

 

Here's the code that I have used to auto-update a property on a deal, telling me how many days the deal sat in that stage. 

if(([properties.dealstage] == "1234567"), time_between([properties.date_became_pql],[properties.todays_date]), if((((([properties.dealstage] == "1234568") || ([properties.dealstage] == "12345689")) || ([properties.dealstage] == "12345690")) || ([properties.dealstage] == "12345691")),time_between([properties.date_became_pql],[properties.hs_date_deal_exited_stage])))