Get all field values from app

Answered

Comments

6 comments

  • Andreas Haugstrup Pedersen

    Hi Marian,

    Use Filter Items to get all your items out https://developers.podio.com/doc/items/filter-items-4496747 and then you just have to loop over the collection and find the value for each field.

    All the best,

    Andreas 

    0
    Comment actions Permalink
  • Marián Šedaj

    thanks Andreas

    0
    Comment actions Permalink
  • Marián Šedaj

    Oh... aaaaaand

    When I use filter.. this filter gets me incredible long object

    F.e. I want to obtain all ids of apps that created items

    1. I use Podio filter to filter all items from single app

    2. I want now to obtain created by -> app id from every item

    So I'd like to have

    array (

    [0] => 3122089;

    [1] => 3122089;

    [2] => 3122085;

    );

    that means that item 0 was created by app 3122089, item 1 by 3122089 etc.

    Hope I'm clear.

    The structure is very wide..

    f.e to get this id ..

     

    Array

    (

        [0] => PodioItem Object

            (

                [__attributes] => Array

                    (

                        [item_id] => 33062928

                        [external_id] => 246

                        [title] => Mac

                        [link] => https://xxx.podio.com/customer-support/item/33062928

                        [rights] => Array

                            (

                                [0] => add_task

                                [1] => subscribe

                                [2] => comment

                                [3] => update

                                [4] => delete

                                [5] => add_file

                                [6] => view

                                [7] => add_conversation

                                [8] => rate

                            )

                        [initial_revision] => PodioItemRevision Object

                            (

                                [__attributes] => Array

                                    (

                                        [revision] =>

                                        [created_on] => 2013-02-07 10:45:42

                                        [created_by] => PodioByLine Object

                                            (

                                                [__attributes] => Array

                                                    (

                                                        [type] => app

                                                        [id] => 3122089 <--here

     

    how to get this kind of array smarter than going through array's object's array

    0
    Comment actions Permalink
  • Andreas Haugstrup Pedersen

    You have an instance of the PodioItem class so you can use the methods and properties on that class. To find the created_by for the initial revision:

    // Provided that your item is in the $item variable

    $created_by = $item->initial_revision->created_by;

    // $created_by is an instance of PodioByLine class, so you have those properties. Just print the ID:

    print $created_by->id; 

    0
    Comment actions Permalink
  • Marián Šedaj

    got it thanks

    0
    Comment actions Permalink
  • Lars Nobel

    error is: Notice: Trying to get property 'titel' of non-object in C:\xampp\htdocs\podio-test-api\app.php on line 28

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk