# Get row COUNT for saved report

**URL:** <https://integration.keap.com/t/get-row-count-for-saved-report/38331>\
**Category:** API Q&A\
**Created:** [April 25, 2018, 7:58pm UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331 "2018-04-25T19:58:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdirin\_Dirin](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@sdirin\_Dirin](https://integration.keap.com/u/sdirin_Dirin)\
**Post date:** [April 25, 2018, 7:58pm UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/1 "2018-04-25T19:58:05Z")

</div>

I need to get a count of record of a saved report. Currently the only way I can do it is to guess the page number and with binary search come to the page I need, but that is too much of api requests and they are so easy to optimize. Besides I can get this number using dashboard widgets.  
Is there a better way?

---

<div class="post-metadata">

**Author:** ![Nicholas\_Trecina](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/nicholas_trecina/32/5338_2.png) [@Nicholas\_Trecina](https://integration.keap.com/u/Nicholas_Trecina)\
**Post date:** [April 25, 2018, 11:51pm UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/2 "2018-04-25T23:51:00Z")

</div>

Hi @sdirin_Dirin, unfortunately there isn’t a way to return the count of a saved report.

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [April 27, 2018, 6:14am UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/3 "2018-04-27T06:14:03Z")

</div>

Hi @sdirin_Dirin,

While that would be a valuable function to have, the api does not present any way to get saved search counts. Depending on how complicated the search is, there are basic searches you could use the dsCount method to determine but that would be very basic searches only.

---

<div class="post-metadata">

**Author:** ![sdirin\_Dirin](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@sdirin\_Dirin](https://integration.keap.com/u/sdirin_Dirin)\
**Post date:** [April 27, 2018, 6:28am UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/4 "2018-04-27T06:28:56Z")

</div>

Yes that is no help. To get my report with table I have to combine 3 big tables and that is gonna take more resources than guessing the last page on saved report. It is just causes too much of “request took too long and has been canceled” errors.

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [April 27, 2018, 6:31am UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/5 "2018-04-27T06:31:33Z")

</div>

Yup, that would be the definition of NOT a simple query. Afraid there isn’t a way then.

---

<div class="post-metadata">

**Author:** ![Pav](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/pav/32/124_2.png) [@Pav](https://integration.keap.com/u/Pav)\
**Post date:** [May 3, 2018, 4:17pm UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/6 "2018-05-03T16:17:24Z")

</div>

Alternative idea here.

What type of report are you running here?

Some fo the Saved Search data would be available in the API Tables.  
I am thinking that if the main data is accessible via an API Table you could run a dsCount on that table with near similar queries. Although depends on how complicated the report is.  
Then it could give you an idea on how many pages their are.

The other alternative is to have the report come back in a particular sort order. You could then store the data in your own database, and reference i from there. But again, it depends on how complicated it is, and if sorting would help or not.

---

<div class="post-metadata">

**Author:** ![sdirin\_Dirin](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@sdirin\_Dirin](https://integration.keap.com/u/sdirin_Dirin)\
**Post date:** [May 3, 2018, 4:48pm UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/7 "2018-05-03T16:48:33Z")

</div>

Hello. Sorting is a good idea. I need Compain Goals Completion report.

---

<div class="post-metadata">

**Author:** ![Pav](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/pav/32/124_2.png) [@Pav](https://integration.keap.com/u/Pav)\
**Post date:** [May 3, 2018, 5:15pm UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/8 "2018-05-03T17:15:12Z")

</div>

Have to dismiss my first suggestion as that data is not retrievable via the API Tables.

I would recommend storing the data in a database when you retrieve it.  
Saves having to hit the API all the time.

---

<div class="post-metadata">

**Author:** ![sdirin\_Dirin](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@sdirin\_Dirin](https://integration.keap.com/u/sdirin_Dirin)\
**Post date:** [May 3, 2018, 5:27pm UTC](https://integration.keap.com/t/get-row-count-for-saved-report/38331/9 "2018-05-03T17:27:48Z")

</div>

Yes I thought about it and the idea of sorting data and save last inserted row seams ok.
