Skip to Main Content
Cumulocity IoT Feedback Portal
Status Added/Resolved 🎉
Categories Runtime Services
Created by Florian Gopp
Created on Mar 18, 2021

Improve paging in c8y API

When implementing data grid with paging to show items fetched using the c8y API the implemented paging is not working very well. In our case we need to get the total count of items (with query params: withTotalPages=true, pageSize=1), the filtered count of items (with query params: withTotalPages=true, pageSize=1, filter query) and the data page it self. Three requests are required to fetch this information. It would be easier if the PagingStatistics would include the total items count and not the count of pages. The count of pages we can calculate by ourself when we need that information. Then we could fetch the required information with two requests (or only one when no filter is applied).

  • Attach files
  • Admin
    Nikolaus Neuerburg
    Mar 9, 2023

    Dear Florian, thanks for the idea and aplogies for the late response. Starting with Cumulocity IoT 10.13 you can use the withTotalElements query parameter which was introduced exactly to reduce the number of requests needed for a data-grid request.