How to get the values of a category field in an app
I want to get all the values that has a category field in an app,
$resp = PodioAppField::get( 10737278, 82913474 );
foreach($resp->config->options as $it){
print_r ($it);
}
Please I need your help, thanks.
-
Hi Victoria,
Field values are attached to items. So you can get all items and loop through all fields for all items:
function printField($app_id, $field_id) {
$items = PodioItem::filter($app_id);
foreach($items as $item) {
print "Item ".$item->title."\n";
foreach($item->fields as $i => $value) {
if ($value->field_id == $field_id ){
print $value;
}
}
}
}Cheers,
Brian
Please sign in to leave a comment.
Comments
2 comments