"Newest" active task in folder

I'm using Wrike API to pull all "active" (i.e., not-completed) tasks in a folder (with subfolder and subfolders and projects under that) because I want to know what is the 'next step' on each of the 168 projects within the parent folder.  I'm running into the 1000 record limit because there's so many tasks per project and so many projects per folder.

Is there any way around this 1000 record limit by using 'sorting' (??) so I only get the most current task for the 168 projects ... other than breaking the query down into each sub-folder?

👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos
1 comment

Hi Ken Hayes, thanks for getting in touch.

Indeed, there is a 1000 tasks limit on the maximum number of tasks returned to the "/tasks" API call. This limit is in place to prevent potential timeouts that can occur when a lot of data is being returned in one sitting. 

No worries - if you don't want to break down the query by subfolders, you can use pagination to work around this limit:

Here's a typical flow for getting large chunks of tasks:

1) Call to GET /tasks/ with your desired parameters and add pageSize  parameter=1000);
2) Retrieve nextPageToken from the response;
3) Call to GET /tasks/ with only nextPageToken=<> parameter

Keep doing steps 2) and 3) until you get to the last page with no nextPageToken in the response, which is your last page in the data set. This way, you should be able to get the full task list if it's longer than 1000 tasks. For more information on pagination, please check this post from my colleague Pavel.

Hope it helps!🙌

Lisa K. Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover

Lisa K. Wrike Team member Become a Wrike expert with Wrike Discover

👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Folllowing List for Post: "Newest" active task in folder
[this list is visible for admins and agents only]

Didn’t find what you were looking for? Write new post