⚙ Operations Hub

Manasa_V
Member

Workflow with Custom Code

SOLVE

I have a contact property called "contact engagement score" and another contact property called "lead status". Whenever the lead status is anything other thank "JUnk", I want an average of all the contact engagement scores, to be input into a custom property at the company record. 

Example: 

contact A - 10
contact B - 5, but junk status
contact C - 16

then the average would be 13, and this value would be appended to the company record in another custom property

need the line of code to solve this using a hubspot workflow with ops hub steps 

0 Upvotes
1 Accepted solution
karstenkoehler
Solution
Hall of Famer | Partner
Hall of Famer | Partner

Workflow with Custom Code

SOLVE

Hi @Manasa_V,

 

I wouldn't do this with a workflow / custom code, but a roll-up property instead: https://knowledge.hubspot.com/properties/create-calculation-properties

 

You can create this property on the company record, let it calculate the average of the associated contact records in that particular field and define a condition.

 

This is a far superior approach compared to workflows as it's not prone to enrollment issues or code errors, and calculates in real-time.

 

Best regards!

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

View solution in original post

0 Upvotes
1 Reply 1
karstenkoehler
Solution
Hall of Famer | Partner
Hall of Famer | Partner

Workflow with Custom Code

SOLVE

Hi @Manasa_V,

 

I wouldn't do this with a workflow / custom code, but a roll-up property instead: https://knowledge.hubspot.com/properties/create-calculation-properties

 

You can create this property on the company record, let it calculate the average of the associated contact records in that particular field and define a condition.

 

This is a far superior approach compared to workflows as it's not prone to enrollment issues or code errors, and calculates in real-time.

 

Best regards!

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

0 Upvotes