how do i get all fields (columns name) by view ? can i use podioApp:get()

Answered

Comments

7 comments

  • Nathan

    Anyone ?

    0
    Comment actions Permalink
  • Nathan

    No one ?

    0
    Comment actions Permalink
  • Nathan

    Really ? no one ?

    0
    Comment actions Permalink
  • Andreas Haugstrup Pedersen

    There's no need to spam the comments. It's not an effective way to get help. It's just an annoyance to people who subscribe to email notifications to this forum.

    I think you are confusing terms here. Perhaps you could explain what you are trying to accomplish and we can take it from there.

    /Andreas

    0
    Comment actions Permalink
  • Nathan

    I am sorry for annoying was not my intention was just trying to get a response.

    well i want to give my users an ability to select space -> app -> view. and then choose fields that belong to that view or app if view was not selected.

     

    So if a user did not select view then its simply i do podioApp:get() and retrieve all the fields belongs to the app.

    However if a user select a view then i have a problem.

    What i do currently to get all fields belong to that view is:

    i user PodioItem::filter_by_view( $app_id, $view_id, $attributes = array() ); i set the limit to 500 and have a while that continue running until i get no results back. ones i have 1 big array with all the records i run through them and collect all the fields.

    This system is bad in several ways 1. i have to waste a rate-limit call , 2. it takes a lot of time, 3. its not accurate (in-case there is a field that has no value - empty column).

     

    No my question is:

    Is there a way to achieve what i am after (getting all fields filtered by view) in a better way.

    maybe using podioApp:get() and iterating through the fields and checking for a certain indicator .. i dont know.

     

    Thanks andreas

     

     

    0
    Comment actions Permalink
  • Nathan

    Would love to get an answer for this.

    0
    Comment actions Permalink
  • Andreas Haugstrup Pedersen

    I still don't understand what you're trying to achieve. The "fields" you get back when you fetch a collection of items are the individual item fields for each individual item. They are only present if they have a value.

    The "fields" you get back when you get the app itself are the app fields on the app. That's the only way to get a complete list of potential fields to use.

    If you want your user to select a group of fields from an app you can forget about fetching 500 items from that app. Just get the app with PodioApp::get() and use the app fields. If a user has selected a "view" you need to use the fields from the app, so you can safely forget about the item fields from PodioItem::filter_by_view()

    /Andreas

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk