question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hubspot object content inconsistencies?

See original GitHub issue

Hi,

After having upgraded to the last version of hubspot3 I find that sometime, when fetching objects from the Hubspot API, i may retrieve dict formatted in different ways regarding objects properties.

Sometimes its the ‘hubspot’ way of formatting object properties:


{'objectId': 47863442,
 'portalId': 5799819,
 'isDeleted': False,
 'objectType': 'PRODUCT',
'properties': {'name': {'value': "My product name",
   'source': 'CRM_UI',
   'sourceId': None,
   'versions': [{'name': 'name',
     'value': "My product name",
     'source': 'CRM_UI',
     'requestId': 'dcb6af03-4c5e-499a-9448-8c689c4f984a',
     'sourceVid': [],
     'timestamp': 1570095121725}],
   'timestamp': 1570095121725},
  'price': {'value': '115',
   'source': 'CRM_UI',
   'sourceId': None,
   'versions': [{'name': 'price',
     'value': '115',
     'source': 'CRM_UI',
     'requestId': 'dcb6af03-4c5e-499a-9448-8c689c4f984a',
     'sourceVid': [],
     'timestamp': 1570095121725}],
   'timestamp': 1570095121725}
}}

and sometimes I only retrieve key / values (not placed under the properties key):

{
    'id': 28612078,
    'name': 'My product name',
    'price': '115',
}

I think that getting a single product will returns to me an hubspot payload while retrieving all the products will return to me prettified products. It seems to be the same thing for most of clients.

I personally prefer the second format that I find more natural for developers. And it could be great to be able to use this format for both input and outputs.

But what I find disturbing is that not all of the clients methods are returning the object information the same way.

What do you think of that?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jissoncommented, Oct 17, 2019

If we are able to define guidelines and goals on this topic I could help 😃

Letting the choice to the user regarding the outputs / input could be interesting. But I am afraid that it would be complicated to handle if users have to deal with an optional boolean flag each time they call a client.

Maybe prettify_output (and input?) could be given once for all at the instantiation of the clients?

Regarding the outputs, I am currently dealing with those inconstancies in my code by checking the presence of the properties key in the data returned by the library. Not ideal but it simple and it works well.

0reactions
jpetruccianicommented, Nov 8, 2019

Sorry I’ve been a bit stalled on this - I haven’t forgotten! Things have been a bit crazy at work recently.

I should be able to get around to this sometime next week!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Review and troubleshoot import errors
When importing records or activities into HubSpot, you may encounter errors. Below, learn how to resolve errors detected during an import, ...
Read more >
Troubleshoot common workflow errors
Learn how to troubleshoot common workflow errors. ... associated with a record, click the Name of the record to access the object record....
Read more >
Resolve Salesforce integration suspension errors
Learn how to resolve HubSpot-Salesforce integration suspension errors.
Read more >
4 Common Custom Reporting Mistakes (And How to Fix Them)
1. Misunderstanding Report Type ... Single object and cross object reports — these are the most frequently used report types in the custom...
Read more >
Manage Salesforce integration API calls and sync errors
Changes made in HubSpot cannot sync to Salesforce because the connected user does not have access to the necessary field or object in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found