I am currently experiencing an issue with a custom script in a Hubspot workflow.
The script is supposed to attribute a referral back to the correct contact by querying the CRM to find a contact matching the referrer value associated to the enrolled contact, and then updating the appropriate properties on both the referring and referred contact.
However, the script is only updating the “referrer” value and not the “number of referrals”, “recent referral date” and “referred by” properties.
Steps to reproduce:
- Enroll a contact in the workflow
- The script should run and update the “number of referrals”, “recent referral date” and “referred by” properties of the referring contact and the “referred by” property of the referred contact
Expected outcome:
- The “number of referrals”, “recent referral date” and “referred by” properties of the referring contact should be updated
- The “referred by” property of the referred contact should be updated
Actual outcome:
- Only the “referrer” value is updated
Notes:
- The properties exist and they are the correct type
- The API key is correct and has the necessary permissions
- The script is running on the correct environment, with all the necessary dependencies installed
- The script is being triggered correctly by the workflow
The obvious reason would be that the API is not working. Why would that happen when it has all required permissions?
This is the error log https://pastebin.com/CsvxWUKG
Appreciate your help!