Custom Workflow Action to find and update a Contact
SOLVE
In short - our forms require two sets of contact details for two individual people. I have a workflow set up that copies the second persons contact details and creates a new contact. However, this doesn't work if the second person already exists as a contact.
I want to create a custom workflow action that will search contacts for an email address, if it exists, update the fields, and if it doesn't exist, create a new contact.
I haven't looked at Python in probably 10 years and certainly need to re-teach myself (and more) to make this work. I wondered if anyone had experience of writing a custom workflow action similiar to this, and could reccomend the best library to learn/use?
You might want to take a look at HubSpot's Contacts API, in particular the upsert endpoint. This endpoint allows updating existing contacts and creates new ones if the unique identifier has no match.
There are sample API requests provided in a couple of languages, in including options for Node and Python as well, which should help you get started:
Hope this helps!
✔️ Did this post help answer your query? Help the community by marking it as a solution.
You might want to take a look at HubSpot's Contacts API, in particular the upsert endpoint. This endpoint allows updating existing contacts and creates new ones if the unique identifier has no match.
There are sample API requests provided in a couple of languages, in including options for Node and Python as well, which should help you get started:
Hope this helps!
✔️ Did this post help answer your query? Help the community by marking it as a solution.