question

SonalMehta-1746 avatar image
0 Votes"
SonalMehta-1746 asked saldana-msft edited

How can we add pagination in To-Do Task List(MS Graph REST APIs), as $skip isn't working?

Hello ,

I am using MS Graph API for todo task lists. (/me/todo/lists). In this case, query parameters like $skip, $count and $search aren't working. Can you please help me out, how can we get pagination done for todo task listing?

For more details:
REST (GET): https://graph.microsoft.com/v1.0/me/todo/lists?$skip=2

In response, getting all the records!
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('info@domain.com')/todo/lists",
value[<<all the values>>]
}

microsoft-graph-teamworkmicrosoft-graph-todo
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SunithaGowda-5199 avatar image
0 Votes"
SunithaGowda-5199 answered MarcRochel-6364 commented

Hi Sonal,
If your goal is to apply filters/pagination on tasks in a list this should help -

https://graph.microsoft.com/v1.0/me/todo/lists/[ListID]/tasks?$skip=2.

if you are filtering tasklist since the $skip is not yet available for to do List api you can try - https://graph.microsoft.com/v1.0/me/todo/lists?$filter=startsWith(displayName,'M')

in general for pagination please refer doc here - https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter

Also, to enable $skip query param on to do lists please create a new ask here on user voice - https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests?category_id=373861



· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Sunitha. My goal is to add pagination on task list. It would be much helpful, if $skip query param is available for task list API as well.

0 Votes 0 ·

Please feel free to add the feature request " Enable $skip query param for task list API " here in uservoice.
https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests?category_id=373861

1 Vote 1 ·

This does not work for me. It does not find all matching tasklists. I have a "Groceries" list in the todo list app. It doesn't find it in Graph Explorer like this

me/todo/lists?$filter=startsWith(displayName,'Groceries')

I can find other tasklists I have that way though.

How can I get the id of my Groceries tasklist? the api doesn't seem to know about that tasklist (as well as some other lists)

0 Votes 0 ·