APIs & Integrations

AkshayPanchal
Member

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

I am trying to build a logic where I am trying to extract the data (list of users) then matching that data and getting the first name and last name. 

Fetch Users: Get the list of users with their userId and id.

Match User: Use the userId to find the corresponding 'id'.

Update Property: Update the custom property 'updated_by_user_name' with the id and another property 'updated by user full name' with the full name.

However, even though the code runs, property is not being updated in HS. 

3 Accepted solutions
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

Hi @AkshayPanchal 

 

"Use HubSpot contact search API to search the contact from there you can get the property of the object as well if it is found. Now you have to Contact update API to update the contact property.
If you are still not able to do this then please let me know and I'll provide the curl of both the API.


If your property is not updated then recheck the internal name of the property you are updating, if it is still not updated please share the SS of error msg you are getting Or share your code."

 

"I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!"




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

0 Upvotes
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

@AkshayPanchal 

As 'updated by user name' is read-only a property then

What you can do here is create a new Custom Company property and then update the new custom property as per your requirements.

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

0 Upvotes
SteveHTM
Solution
Guide | Partner
Guide | Partner

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

@AkshayPanchal - just validated that Company property 'hs_updated_by_user_id' does return the value indicated in the owners API and designated as 'userId' in that JSON.

 

I'd advise a two step test:

- make sure you can write a static test string successfully to your custom Company property

- Mkae sure you matching code for userId returns valid first/last name values

 

If both these work, then, as I understand your question, you should be in business.

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature

View solution in original post

0 Upvotes
8 Replies 8
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

Hi @AkshayPanchal 

 

"Use HubSpot contact search API to search the contact from there you can get the property of the object as well if it is found. Now you have to Contact update API to update the contact property.
If you are still not able to do this then please let me know and I'll provide the curl of both the API.


If your property is not updated then recheck the internal name of the property you are updating, if it is still not updated please share the SS of error msg you are getting Or share your code."

 

"I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!"




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes
AkshayPanchal
Member

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

Hi @GRajput ,
Thanks for input, this property is on company level. Hence, would need company API's is what I assume. The problem is according to the log, the code was implemented successfully but somehow the values do not show up in the property. 
As I am totally new to the HubSpot custom code world I am still researching what could go wrong. 

0 Upvotes
SteveHTM
Guide | Partner
Guide | Partner

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

@AkshayPanchal - it seems likely that these 'updated_by' properties are read only and set by HubSpot. Can you check this?

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Upvotes
AkshayPanchal
Member

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

@SteveHTM Yes I figured this yesterday that this property is read-only.  So switched my approach.
what I am now stuck with is that if there is a user that makes changes to one of my company property. This user should be reflected in another property 'updated by user name' but still no success. 


 

0 Upvotes
SteveHTM
Guide | Partner
Guide | Partner

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

Also bear in mind that there are now 3 (yes three) different user IDs which are used for different purposes in HubSpot - make sure you have the right ID type or translate from one to another using the APIs.

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Upvotes
AkshayPanchal
Member

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

@SteveHTM on calling the owners API, this is what I see normally. I can see two id's but not sure of the third id.
Screenshot 2024-10-16 at 14.30.10.png

SteveHTM
Solution
Guide | Partner
Guide | Partner

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

@AkshayPanchal - just validated that Company property 'hs_updated_by_user_id' does return the value indicated in the owners API and designated as 'userId' in that JSON.

 

I'd advise a two step test:

- make sure you can write a static test string successfully to your custom Company property

- Mkae sure you matching code for userId returns valid first/last name values

 

If both these work, then, as I understand your question, you should be in business.

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Upvotes
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Trying to update user's first name and last name based on property 'updated by user id'

SOLVE

@AkshayPanchal 

As 'updated by user name' is read-only a property then

What you can do here is create a new Custom Company property and then update the new custom property as per your requirements.

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes