Jun 20, 20231:30 PM - last edited on Jul 10, 20233:03 PM by Jaycee_Lewis
Contributor
Issue with my code not writing data back to a Deal with the updated value
SOLVE
All,
I am trying to do the following in Deals. If the amount is null or = 0 then replace the amount with the Total Contract Value (hs_tcv). My flow appears to do everything, no errors but the amount field stays blank. Below is the code and a screen shot of my input and output variables.
Issue with my code not writing data back to a Deal with the updated value
SOLVE
Hey everyone, I finally figured it out (duh). I needed to add a step in the workflow that actually copies that value BACK to the deal from the custom code. I assumed that the code actually wrote data back but it only writes data back to the custom code workflow object.
Issue with my code not writing data back to a Deal with the updated value
SOLVE
Hi Richard, in that case, could you just copy across the Deal TCV?
workflow triggers on TCV property is 'known', and permits deal re-enrollment
then copies the Deal TCV property to Deal Amount
That property is also automatically updated by HubSpot per deal. If you need custom code then sure thing - I was just curious as there are four calculated fields on each deal that you can copy to deal amount:
Total contract value (TCV),
Annual contract value (ACV),
Annual recurring revenue (ARR)
and Monthly recurring revenue (MRR).
We ended up writing a help page on automating deal value because it comes up regularly for apps like DoPricer which change line item prices and discounts in the background via the API. So the workflow keeps the deal amount accurate.
Issue with my code not writing data back to a Deal with the updated value
SOLVE
Hey @RReiffer , Glad to see you found a solution to this.
I did notice that in your initial post you've used what looks like your access token. Just wanted to make sure that you changed this as otherwise people can access your Hubspot data via API with this.
Issue with my code not writing data back to a Deal with the updated value
SOLVE
Good catch, @KimM🙌 I went ahead and edited it out of the original post. And, @RReiffer should definitely rotate that key if they haven't already. — Jaycee
Issue with my code not writing data back to a Deal with the updated value
SOLVE
Hey everyone, I finally figured it out (duh). I needed to add a step in the workflow that actually copies that value BACK to the deal from the custom code. I assumed that the code actually wrote data back but it only writes data back to the custom code workflow object.