How can I access fields within a related item?
I am having trouble with accessing fields within a related item when using PHP and the API.
I am querying, for example, a Deal item that has a related Company item.
I'm confused with the layers of XML to access fields from the related Company.
$company = !empty($deal->fields['company']->values) ? $deal->fields['company']->values[0]->title : "";
I got as far as listing the item title, but if I wanted to get values for another field within the related Company item, is that possible?
At the moment I had to write a separate function to pass the item ID into and do a query for the field info I am after, but it seems like the full info for the related items is returned in the initial query already.
-
Official comment
Hi Joshua,
for performance reason we don't retrieve all the related items with all their contents, but only whatever is configured in their Reference Badge (see here for more info: https://help.podio.com/hc/en-us/articles/208195878-Reference-badges-customise-what-related-items-look-like)
If you need more than that, you will have to get the item with another call.
Hope that helps.
Best,
DomenicoComment actions
Please sign in to leave a comment.
Comments
1 comment