Post

1 follower Follow
0
Avatar

get value of external_id like defined on 'developers/hook' page in app

Hi,

using podio php api, how do i get the value of a field from an item in an app using external_id like defined on the 'deverlop/hook' page of that app?

i'm unable to find it through all those arrays...

 

Kind regards,

Anthony

Anthony Viaene Answered

Please sign in to leave a comment.

2 comments

0
Avatar

If you are looking through a ton of arrays you are probably using an old version of the PHP client. So go over to https://github.com/podio/podio-php and fetch a new version. Beware there are many syntax changes in the new version. These are made to solve your exact problem.

After that you can see a bunch of examples of how to work with items in https://github.com/podio/podio-php/blob/master/examples/items.php

For your specific case. Here is how to get an item, get a specific field by external id and then print the human friendly value of that field.

$item = PodioItem::get($item_id);

// Get the field with external id 'title'

$field = $item->field('title');

// Print human friendly value

print $field->humanized_value();

// Raw values are available in $field->values 

Andreas Haugstrup Pedersen 0 votes