APIs & Integrations

PAllmond
Contributor

How to create this custom object relationship

SOLVE

I'm wanting to create an Events objects and a Registration (which will join multiple events to multiple contacts) object. In what order do I create them? The reason I ask is that the API looks like some kind of association is required. I need to create the Events with NO associations so I can then create the registrations object and associate it with contacts and events. Hopefully all of that makes sense. 

0 Upvotes
1 Accepted solution
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

How to create this custom object relationship

SOLVE

@PAllmond 

Let's get the association setup.

Every object in HubSpot is initially not associated with anything.  That extends to engagements even so after you create an object record, you will then have to create the association for that record to whatever you want to associate it with. 

Speaking specifically about custom objects, because you define the schema when you create the object, you will need to also create the ability to associate it with other object types.  That is detailed on this doc under the "Defining a new association" section.

 

With regards to your flow, I question the need for the tickets object.  In my mind, I see that as a property within the events object.  You could set that ticket property to the number of available tickets and through the use of a workflow decrement the value and (assuming you are using the HubSpot CMS) show the available tickets on the event landing page (good use of dynamic pages for this!).  Once the value = 0, you could display a sold out message or wait list etc. 

 

There is a lot that can be done here!  Hopefully soon, Custom Objects will have access to association labels so you could create a custom label for people on a waitlist for example.  You can read more about that here.

 

@Teun is a much smarter person than I am and may have some better ideas.  Regardless, let us know how it all works out.  This is a fun project.

View solution in original post

0 Upvotes
4 Replies 4
dennisedson
HubSpot Product Team
HubSpot Product Team

How to create this custom object relationship

SOLVE

@Bryantworks , what would your strategy be here?

@PAllmond , it may be worth walking through the full flow so we get a really good picture 😀

0 Upvotes
PAllmond
Contributor

How to create this custom object relationship

SOLVE

Thanks. You are the ONLY person who has responded to me here or in the Hubspot Slack 🙂 

 

Our goal is event management. So I was thinking of creating an Events Object and. Ticket object. The main goal of the Events object is to hold all of the event details. The main goal of the tickets is to store the associated Contact and Event objects as well as any info about the individual event registration. I come from a world of database design. This seems to be the best way to store info when you have many events and contacts. It's a many to many relationship. I am just not sure how to create the objects because it's a chicken and egg situation. Can I create the Events object with NO associations and then create the ticket object? It seems like every object has to have a related object when it is created. Am I wrong on that ? I hope so 🙂 

dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

How to create this custom object relationship

SOLVE

@PAllmond 

Let's get the association setup.

Every object in HubSpot is initially not associated with anything.  That extends to engagements even so after you create an object record, you will then have to create the association for that record to whatever you want to associate it with. 

Speaking specifically about custom objects, because you define the schema when you create the object, you will need to also create the ability to associate it with other object types.  That is detailed on this doc under the "Defining a new association" section.

 

With regards to your flow, I question the need for the tickets object.  In my mind, I see that as a property within the events object.  You could set that ticket property to the number of available tickets and through the use of a workflow decrement the value and (assuming you are using the HubSpot CMS) show the available tickets on the event landing page (good use of dynamic pages for this!).  Once the value = 0, you could display a sold out message or wait list etc. 

 

There is a lot that can be done here!  Hopefully soon, Custom Objects will have access to association labels so you could create a custom label for people on a waitlist for example.  You can read more about that here.

 

@Teun is a much smarter person than I am and may have some better ideas.  Regardless, let us know how it all works out.  This is a fun project.

0 Upvotes
PAllmond
Contributor

How to create this custom object relationship

SOLVE

Thanks . I see the need of the ticket object because we need to track things like: Ticket level, price paid (that varies). So it's for more than just tracking number of available tickets (which should be stored at the ticket level) 

 

I think you did help clarify something for me. I can create an object with zero initial associations. Then come back and do that later.