pipedrive/client-nodejs

Cant use customFields which start with a numeric literal

christuri opened this issue · 4 comments

Unfortunately some of the custom Fields in the API-response start with a numeric literal (8fdc.....) which makes it impossible to read them.

Parsing error: An identifier or keyword cannot immediately follow a numeric literal.

Couldn't find anything in the docs if there is a workaround for that. Is that a known issue?

Hello. Thanks for letting us know.
Could you please add more information under which circumstances you experienced this issue.
Steps to reproduce would also be helpful.

Thank you

Hey, sure!

I think this isn't really a problem of the API but instead of how you assign ID's to custom values in the backend 🤔

No matter if I call the API with getDeal(id) / getOrganisation(id) or copy the API-Key from inside Pipedrive there are a lot of fields where the ID starts with a number.

Bildschirmfoto 2021-11-17 um 13 46 44

When I try to store the value inside a new variable after calling it with node or try to just log it I get the error I wrote above. For ID's which start with a-z its no problem to use them.
Bildschirmfoto 2021-11-17 um 13 50 27

Really wondering if nobody had that problem before or if there is a workaround.. Couldnt find anything online!

Thanks!

Hello @christopherturinsky There's no problem with Pipedrive, there's a gap in your Javascript knowledge. To access any property of an object - including a property which begins with a number - you have to use index notation instead:

const domains = product['84c5ce1b42...']

Using dot operator something.property, you can only access property which name follows certain rules, like not containing spaces and not beginning with a number. Otherwise you have to use index notation.

Ahhh thank you, don know why I haven't tried this 🤦