Is there a way to get all item IDs in the user's last view?

Comments

9 comments

  • Andreas Garnæs

    Hi Timo, if you call Filter Items by View and pass in 0 for view_id, it will apply the user's last view: https://developers.podio.com/doc/items/filter-items-by-view-4540284

    1
    Comment actions Permalink
  • Timo Sillander

    Thanks!

    That saves me some code but it's still slooooooow.
    Takes about 20s to load just 200 items.

    I can get around the slowness with caching in just about every other situation but this; there's no way (that I can think of) to cache or retrieve current user's last view's items for a given app. All I need is the IDs, everything else is already cached.

    1
    Comment actions Permalink
  • Andreas Garnæs

    Can you share a request id from the HTTP response headers so I can investigate?

    1
    Comment actions Permalink
  • Timo Sillander

    Sure. Here: uqhVV6FT

    1
    Comment actions Permalink
  • Andreas Garnæs

    I can see that the response contains a massive amount of data. You can consider adding the query parameter fields=items.view(micro) to exclude of lot of information in the response and see if that helps.

    1
    Comment actions Permalink
  • Timo Sillander

    Whoa, quite a difference: that cut about 96% from our test query's execution time! Thank you very much!

    I take it that PodioItem::filter_by_view does not have this option?

    1
    Comment actions Permalink
  • Andreas Garnæs

    It looks like the current implementation of filter_by_view does not accept query parameters, but it should be very easy to add -- see the filter function (specifically the $options parameter): https://github.com/podio/podio-php/blob/eca10604157b880cad5528ccaf43b2c81d791860/models/PodioItem.php#L126-L129

    Pull requests gladly accepted ;)

    1
    Comment actions Permalink
  • Timo Sillander

    Pull request submitted!

    0
    Comment actions Permalink
  • Andreas Garnæs

    Thanks! It's already been merged :)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk