Get total row count from List Single (BETA)?

Hi all

Is there a way to see the TOTAL row count when using List Single (BETA), or do you need to just keep increasing the page number until you get {"count":0,…}?

TIA,
-Joel

Comments

  • I think the definition of Count in this endpoint might be an error. Other list-type endpoints - eg Constituent List, Ledger Summary (List) - provide a count of the total number of available records (after any filters have been applied).

    Steve Cinquegrana | CEO and Principal Developer | Protégé Solutions

  • Jared Harbour
    Jared Harbour Blackbaud Employee
    Eighth Anniversary Kudos 1 Name Dropper Participant

    Sadly you do need to continue to increase the page number until the count of records is less than 1000 (which signals you got the last page of records). I understand this is less than ideal but it is the best way to maintain existing functionality but also improve performance.

  • Jared,

    I have seen many other APIs that have a count of total pages in the response to help cycle through the results. Would it be possible to get that implemented? ie. a response of totalPage = n would be great so we don't keep cycling through blindly.

  • Jared Harbour
    Jared Harbour Blackbaud Employee
    Eighth Anniversary Kudos 1 Name Dropper Participant

    Unfortunately, it isn't possible to implement this due to the nature of the advanced list system itself. The count property isn't an error, with this endpoint it shows the total count of records in the current result set where each page maxes out at 1000 records.

    Each new call will bring back the next set of 1000 from the full result set until there are less than 1000 records left. At that point, the count property will show less than 1000 results, and based on that you know you have all your data.

  • Jared,

    This assumes that there are more or less than 1000 results. When there are exactly 1000 records, the function will have to be called again for “page 2” which is an unnecessary call just to check for “the end” of the recursion. I hope that the team would be able to find a better solution, at the moment I will be adding logic for recursion until results = 0.

Categories