# Troubleshooting Custom Coded Actions

**URL:** <https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342>\
**Category:** Data Hub\
**Created:** [August 11, 2023, 9:03pm UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342 "2023-08-11T21:03:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![spen\_wood](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/spen_wood/32/75401_2.png) [@spen\_wood](https://community.hubspot.com/u/spen_wood)\
**Post date:** [August 11, 2023, 9:03pm UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/1 "2023-08-11T21:03:35Z")

</div>

I’m brand new to Javascript and Marketing Ops and I’ve recently been following a guide Jack Coldrick created on building a [referral program.](https://events.hubspot.com/events/details/hubspot-hubspot-academy-presents-custom-automation-masterclass-workshop-3-creating-a-referral-program/)  
Since he wrote the guide, the syntax used to connect to the API has changed a little bit which is reflected in lines 12-15 in the code I’ve attached.  
In this particular action, Hubspot is supposed to be able to find a contact with the Referrer ID that matches a number that a prospect put into a form when they signed up for a demo. The action then updates a number of things on that same contact. (See the [guide link](https://events.hubspot.com/events/details/hubspot-hubspot-academy-presents-custom-automation-masterclass-workshop-3-creating-a-referral-program/) for more details.)  
I’ve spent the better part of this week running through every troubleshooting tip and article that I’ve been able to find, but my code still runs an error when enrolling a contact. Any idea what might be wrong with my syntax?  
Any and all help would be appreciated!

 ![Screen Shot 2023-08-11 at 2.55.13 PM.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/c/5c289685ded7655830e8c2b7e6280bc33cce2268.jpeg)

 ![Screen Shot 2023-08-11 at 2.55.01 PM.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/a/ba33e63d9528b8ec91c8ee8139bbefe8e8b1cfa8.jpeg)

 ![Screen Shot 2023-08-11 at 2.54.41 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/d/5d1606d66fc285686099229910513a5cfb203644.png)

---

<div class="post-metadata">

**Author:** ![timo1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/timo1/32/52600_2.png) [@timo1](https://community.hubspot.com/u/timo1)\
**Post date:** [August 14, 2023, 12:52am UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/2 "2023-08-14T00:52:27Z")

</div>

Hi [@spen\_wood](https://community.hubspot.com/t5/user/viewprofilepage/user-id/614209),  
I’ve recently implemented this for my company and had a similar issue I managed to fix! I can’t see the code snippet attached, could you send it again and I’ll have a look?

---

<div class="post-metadata">

**Author:** ![spen\_wood](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/spen_wood/32/75401_2.png) [@spen\_wood](https://community.hubspot.com/u/spen_wood)\
**Post date:** [August 14, 2023, 8:53pm UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/3 "2023-08-14T20:53:43Z")

</div>

@timo1 Good catch, forgot the screenshots… thanks.

---

<div class="post-metadata">

**Author:** ![timo1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/timo1/32/52600_2.png) [@timo1](https://community.hubspot.com/u/timo1)\
**Post date:** [August 15, 2023, 2:14am UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/4 "2023-08-15T02:14:57Z")

</div>

[@spen\_wood](https://community.hubspot.com/t5/user/viewprofilepage/user-id/614209) What error are you getting? Can you take a screenshot?

---

<div class="post-metadata">

**Author:** ![spen\_wood](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/spen_wood/32/75401_2.png) [@spen\_wood](https://community.hubspot.com/u/spen_wood)\
**Post date:** [August 15, 2023, 9:44pm UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/5 "2023-08-15T21:44:25Z")

</div>

It’s not really giving me anything specific unless I’m just looking in the wrong spot. This is all I can figure out

 ![Screen Shot 2023-08-15 at 3.43.18 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/1/18e3bda43f7d0b8023e2a7669ae556e17080f5ad.png)

 ![Screen Shot 2023-08-15 at 3.42.36 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/3/e322ae2c42a5589cd4b8d92e348c27e0d63838d0.png)

---

<div class="post-metadata">

**Author:** ![spen\_wood](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/spen_wood/32/75401_2.png) [@spen\_wood](https://community.hubspot.com/u/spen_wood)\
**Post date:** [August 15, 2023, 9:48pm UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/6 "2023-08-15T21:48:59Z")

</div>

Actually found it

 ![Screen Shot 2023-08-15 at 3.47.36 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/0/90f52fd65651b2d990e8977a098fbb79845ee3c8.png)

---

<div class="post-metadata">

**Author:** ![timo1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/timo1/32/52600_2.png) [@timo1](https://community.hubspot.com/u/timo1)\
**Post date:** [August 16, 2023, 3:29am UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/7 "2023-08-16T03:29:25Z")

</div>

We had to adjust the search query, converting the referrer id to a string so it could be matched. We also changed some of the syntaxes within the search as they were outdated.  
Have a look at this and make some amends to yours.

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/3/d3d816401dec23e3ff5765997be7548b065f62a3.jpeg)

Note: instead of “referrer” I named my property referrer code.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [May 1, 2024, 10:55am UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/8 "2024-05-01T10:55:26Z")

</div>

Verify that your code syntax aligns with the updated standards. Double-check API connection and Referrer ID matching. Review error messages and debug using [coding tools](https://medicalbillingz.com/career-outlook-of-medical-coding-for-doctors/). Explore relevant API documentation and seek community support. Persistence pays off in debugging!

---

<div class="post-metadata">

**Author:** ![John](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/john/32/43512_2.png) [@John](https://community.hubspot.com/u/John)\
**Post date:** [August 15, 2023, 1:42pm UTC](https://community.hubspot.com/t/troubleshooting-custom-coded-actions/87342/9 "2023-08-15T13:42:13Z")

</div>

One thing I would try is using the hubspot api with axios instead of the node hubspotclient – I’ve never had any luck with that thing
