Skip to content
Advertisement

I fetch data from podio CRM using PHP

I fetch data from podio CRM using PHP language and I fetch data for each element via its id as it is found in this function:

JavaScript

For example we have the ‘Status’ we show it like this:

JavaScript

Not all elements get it right though it is the same function.

Sometimes :

JavaScript

and sometimes :

JavaScript

Can we know what caused the problem?

Advertisement

Answer

If some fields are empty they will not be presented in the PodioItem object, that is why the position of a particular field in the array may vary (like a Status field in your example).

So instead of using a field index (which may vary), you should get the value from a field by field’s External ID (a human readable name like ‘title’, ‘status’ etc) or Field ID (a numeric code):

JavaScript

To know what External ID and Field ID are for a particular field you can list all fields like this:

JavaScript

Or you can see developer’s info on all fields right in Podio in App menu → Developer

enter image description here

And anyways, check the Podio PHP wrapper documentation at https://podio-community.github.io/podio-php/items/ it is pretty useful:)

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement