APIs & Integrations

kaious
Top Contributor

Is owner ID different to created by ID?

I feel like I might be going crazy here, but do created by ID and Owner ID have different sets of values?

 

I'm trying to get around the fact that custom objects don't get assigned owners by default. I have created a workflow that is triggered when the particular custom object is created without an owner. It then triggers a webhook call to Zapier:

Screen Shot 2023-02-14 at 4.23.54 PM.png

 

This sends the created by user ID and the Object ID to zapier.


When it hits Zapier, I am using a JS code step and the HubSpot API to update the custom object owner ID field. 

 

When I run this, it gives me an error, saying the owner ID can't be found – here's an example from running for a custom object that I created:

The app returned "Property values were not valid: [{"isValid":false,"message":"7357965 was not a valid owner ID","error":"INVALID_OWNER_ID","name":"hubspot_owner_id"}]".

If I look up my owner ID inside HubSpot (ie go to any owner field and look at internal values, it is not 7357965 as seems to have been passed to Zapier, but instead is 35053640).

The only possible explanation I can come up with is that Owner ID and Created by ID are using a different set of IDs. But surely that's not the case?? 

0 Upvotes
10 Replies 10
kaious
Top Contributor

Is owner ID different to created by ID?

Yeah, so apparently the created by ID is a lookup of the user ID of the person who created the record, but the owner ID is a separate ID which also relates to a user, but is a compltely different set of IDs.

 

The solution was to add a lookup step to lookup the HubSpot user from Zapier to get the owner ID associatied with that user.

 

I would love someone at HubSpot to explain the logic of having two completely different unique numeric IDs like this, because from where I'm sitting it just seems bizzare?

0 Upvotes
MCruz69
Contributor

Is owner ID different to created by ID?

I used to work there I can probably answer:
created_by_userid would let you say "I want to delete everything that user X created regardless of if that record was later assigned to a different owner"
lots of applications for it

MCruz69
Contributor

Is owner ID different to created by ID?

to make this clearer
owner id: the current owner
created by id: the user who created it
they are not always going to be the same user

0 Upvotes
kaious
Top Contributor

Is owner ID different to created by ID?

The thing I'm questioning is not the two separate fields, it's the two separate sets of IDs.

I totally get that they could be different users, but why does each field use different IDs for the same user – ie if I am the creator AND the owner on an object, the owner ID and the created by ID are different (same user, different IDs). That's the piece that makes no sense to me.

You could easily have the created by ID be a static value using the same set of user IDs as the owner ID field references – there doesn't need to be two different sets of IDs for each HubSpot user.

kaious
Top Contributor

Is owner ID different to created by ID?

To make this clearer:

A record that I own and created:
Owner ID = 7357965
Created By ID = 35053640

If I look up the owner and creator in HubSpot in the UI, it clearly shows my user for both.

MCruz69
Contributor

Is owner ID different to created by ID?

Oh that is bonkers. They have their own internal IDs about users at large, I guess it could be that. 

0 Upvotes
kaious
Top Contributor

Is owner ID different to created by ID?

Yeah, wacky huh?

0 Upvotes
MCruz69
Contributor

Is owner ID different to created by ID?

I don't know when, but this will save me a huge headache in the future, so thank you for pointing this out. Yes thoroughly agree it's wacky lol

kaious
Top Contributor

Is owner ID different to created by ID?

haha, you're welcome – I did search for a bit and couldn't find anything to confirm my suspicion, so thought it was worth posting.

MCruz69
Contributor

Is owner ID different to created by ID?

They could be different. The created by user ID is a static value, however Owner is their current owner and that value is not necessarily static. 
Side note for anyone reading in the future: If you want to find your owner ID, a good way is to go to Settings > Properties and then edit the Owner property. The internal value there is what you want to use. 

0 Upvotes