⚙ Operations Hub

spen_wood
Participant

Troubleshooting Custom Coded Actions

SOLVE

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.

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 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.pngScreen Shot 2023-08-11 at 2.55.01 PM.pngScreen Shot 2023-08-11 at 2.54.41 PM.png

1 Accepted solution
timo1
Solution
Contributor

Troubleshooting Custom Coded Actions

SOLVE

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.

Screenshot 2023-08-16 at 1.28.08 PM.png

 

Note: instead of "referrer" I named my property referrer code.  

View solution in original post

8 Replies 8
John
Guide | Platinum Partner
Guide | Platinum Partner

Troubleshooting Custom Coded Actions

SOLVE

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



I like kudos almost as much as cake – a close second.

timo1
Contributor

Troubleshooting Custom Coded Actions

SOLVE

Hi @spen_wood

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? 

Anonymous
Not applicable

Troubleshooting Custom Coded Actions

SOLVE

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. Explore relevant API documentation and seek community support. Persistence pays off in debugging!

0 Upvotes
spen_wood
Participant

Troubleshooting Custom Coded Actions

SOLVE

@timo1 Good catch, forgot the screenshots... thanks.

0 Upvotes
timo1
Contributor

Troubleshooting Custom Coded Actions

SOLVE

@spen_wood What error are you getting? Can you take a screenshot? 

spen_wood
Participant

Troubleshooting Custom Coded Actions

SOLVE

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.pngScreen Shot 2023-08-15 at 3.42.36 PM.png

0 Upvotes
spen_wood
Participant

Troubleshooting Custom Coded Actions

SOLVE

Actually found it

Screen Shot 2023-08-15 at 3.47.36 PM.png

0 Upvotes
timo1
Solution
Contributor

Troubleshooting Custom Coded Actions

SOLVE

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.

Screenshot 2023-08-16 at 1.28.08 PM.png

 

Note: instead of "referrer" I named my property referrer code.