Post

2 followers Follow
0
Avatar

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.

Victoria Aparicio

Please sign in to leave a comment.

2 comments

0
Avatar

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

Brian Stengaard 0 votes
0
Avatar

Hello Brian, I want to get all the values of a category field from an app.

If I got the values from items, I Just got the selected, I want to get all the values from the template, please 

Victoria Aparicio 0 votes