I'm creating a class with different methods to get values out of Podio fields. My idea was to create a program being able to get an X number of fields from an app. And it should be possible to delete fields or create new fields in the Podio app. I have created the application but somehow the program stops getting the values from the app, when I make some changes in Podio. I think the issue is in this method. This method should get all the external values of the fields, but the method stops getting some of the them when I change the app in Podio. I hope it makes sense. Otherwise please ask me for further details. The method is here:
public function getAllExternalIds(){
// Get the first item of the app, only 1 item
$items = PodioItem::filter($this->app_id,array('limit' => 1));
// Create external_id array
$exIds = array();
// find all the external Ids of the item and put them in the array
for($j=0;$j <count($items['items'][0]->fields) ;$j++){
$exIds[$j] = $items['items'][0]->fields[$j]->external_id;
}
//return the external Id array;
return $exIds;
}
The same issue is in this method:
public function getAllFieldNames(){
$items = PodioItem::filter($this->app_id,array('limit' => 1));
$fieldNames = [];
for($j=0;$j <count($items['items'][0]->fields) ;$j++){
$fieldNames[$j] = $items['items'][0]->fields[$j]->label;
}
return $fieldNames;
}