Appending to data fields rather than replacing them with PHP intergration


I have a small PHP script for creating or updating a contacts info, in this case what event they are signing up for. My issue is that if a contact has already signed up for an event and they have an event ID in that custom field in hubspot, I need the next event they sign up for to be added to that list and not have it replace the current event ID…

So it would go something like this:

  1. First event a user signs up for, they are created as a new contact in hubspot and a field call ‘events’ is given the events ID… say ‘5’

  2. Second event a user signs up for (maybe a month later let’s say), this new event ID is added so that the field has the value of 5,12 (with 12 being the new event ID)

Hopefully that makes sense. I can share the PHP code I’m using if that helps.