# Filtering a Paginated Xano Database

**URL:** <https://community.weweb.io/t/filtering-a-paginated-xano-database/8768>\
**Category:** Ask us anything\
**Created:** [May 24, 2024, 1:23pm UTC](https://community.weweb.io/t/filtering-a-paginated-xano-database/8768 "2024-05-24T13:23:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nico](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/nico/32/12975_2.png) [@nico](https://community.weweb.io/u/nico)\
**Post date:** [May 24, 2024, 1:23pm UTC](https://community.weweb.io/t/filtering-a-paginated-xano-database/8768/1 "2024-05-24T13:23:17Z")

</div>

Hi there. I’m following this tutorial [https://youtu.be/hJDpWGyeQoQ?si=XR70Np\_WQU5b7Tee](https://youtu.be/hJDpWGyeQoQ?si=XR70Np_WQU5b7Tee) and it works fine but only with No paginated Xano DB; when I try to apply it to a Xano Paginated database the search filter does not work in the backend & frontend.

I appreciate your assistance.

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [May 24, 2024, 3:13pm UTC](https://community.weweb.io/t/filtering-a-paginated-xano-database/8768/2 "2024-05-24T15:13:43Z")

</div>

Hi @nico 👋

Can you provide a bit more detail about how things are setup on your side? Maybe share some screenshots or a short video explaining what you’re trying to achieve, how things are setup in Xano and WeWeb, what you tried so far, and where you’re stuck.

It’ll make it easier for us to reproduce your use case and help out.

Thanks!

---

<div class="post-metadata">

**Author:** ![nico](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/nico/32/12975_2.png) [@nico](https://community.weweb.io/u/nico)\
**Post date:** [May 24, 2024, 4:00pm UTC](https://community.weweb.io/t/filtering-a-paginated-xano-database/8768/3 "2024-05-24T16:00:35Z")

</div>

Thank you for your answer Joyce.

I share with you my Xano & WeWeb screens and two videos.

When I use a filter/search in the backend it works correctly but there are a lot of records in the database so I made another api endpoint with pagination, it works correctly but when I add a filter/search in the backend it doesn’t work.

 ![Xano 01](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/0b2684246b3613c558468385f1c706b27b54addd.png)  
 ![Xano 02](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/8ad41872d4049c9a93a3a6c7d940de0fe2b79b03.png)  
 ![Xano 03](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/6/696499c35dc2433d2c9bc577996cdd01c499b671.png)

Xano debug video: [Watch xanoSearch | Streamable](https://streamable.com/ek72h9)

WeWeb screens

 ![weweb 01](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/9/9b607a18ef24683d5aed7e32bb794745f6e1c159.jpeg)  
 ![weweb 02](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/b8bf038bbe801a174826853be3ecc6070814054f.png)  
 ![weweb 03](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/851102176e853f1dcb3e4180f42073b75e398e6c.png)

WeWeb video: [Watch priority Search | Streamable](https://streamable.com/ih7qda)

---

<div class="post-metadata">

**Author:** ![nico](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/nico/32/12975_2.png) [@nico](https://community.weweb.io/u/nico)\
**Post date:** [May 24, 2024, 7:46pm UTC](https://community.weweb.io/t/filtering-a-paginated-xano-database/8768/4 "2024-05-24T19:46:47Z")

</div>

Xano support couldn’t give me a solution to Search in a Paginated Endpoint.  
All their examples works only when Endpoint isn’t paginated.

---

<div class="post-metadata">

**Author:** ![FHEXL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fhexl/32/13607_2.png) [@FHEXL](https://community.weweb.io/u/FHEXL)\
**Post date:** [May 24, 2024, 9:08pm UTC](https://community.weweb.io/t/filtering-a-paginated-xano-database/8768/5 "2024-05-24T21:08:24Z")

</div>

Hi @nico,

when you use page and per\_page in Xano, don’t use offset in Xano. it is either page and per\_page (limit) or per\_page and offset.

Use search only in the XANO query like tracking\_number includes. Beware includes only works on string values.

In this way you should be able to use backend filtering, pagination and (external) sorting.

Sidenote: Sorting doesn’t correctly work on add-ons in xano. When it is implement it is only working on the current page. This is because in Xano add-ons are rendered/included in the response after the initial output of a query. In that case you need to use evals.

---

<div class="post-metadata">

**Author:** ![nico](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/nico/32/12975_2.png) [@nico](https://community.weweb.io/u/nico)\
**Post date:** [May 28, 2024, 3:20pm UTC](https://community.weweb.io/t/filtering-a-paginated-xano-database/8768/6 "2024-05-28T15:20:38Z")

</div>

Hello @FHEXL  
Query Search doesn’t work when API endpoint is paginated so i decided to paginate in frontend although my web app will run slowly. Thank you!

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [May 28, 2024, 6:18pm UTC](https://community.weweb.io/t/filtering-a-paginated-xano-database/8768/7 "2024-05-28T18:18:22Z")

</div>

Hi @nico 👋

> [@nico](#):
>
> Query Search doesn’t work when API endpoint is paginated

What do you mean by “query search”?

I don’t know if it would solve your problem but, in level 2 of the Academy, we have a collection that is paginated in Xano and has a `search` input in Xano as well.

It seems to be working ok.

Here when I look for tickets that contain “unable”, Xano returns only one ticket:

 ![CleanShot 2024-05-28 at 20.14.24@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/5/5a936ec654d56de7fcfe7c5ce425286da6f2e39d.jpeg)

And so there’s only one page in the collection metadata:

 ![CleanShot 2024-05-28 at 20.15.08@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/27968c987fb914af2651790e755711f93ff1e8e9.png)

But if I don’t search for anything, I get the first 25 items from the table and information that there are 995 items in total so 40 pages overall:

 ![CleanShot 2024-05-28 at 20.15.45@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/e7fbde44b82f879528dfdfdaaf3b3b813a37f9bd.png)

Does that help or not at all? If you want to take a look at a starting point, don’t hesitate to take a look at our ticketing app template and the Xano snippet that comes with the academy course:

 ![CleanShot 2024-05-28 at 20.17.33@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/cd8d68bb6498f0c8b6ab676433f3f06604fc45df.png)
