# Supabase REST API - not able to apply filters

**URL:** <https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722>\
**Category:** How do I?\
**Created:** [July 15, 2024, 8:58am UTC](https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722 "2024-07-15T08:58:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://community.weweb.io/u/julian)\
**Post date:** [July 15, 2024, 8:58am UTC](https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722/1 "2024-07-15T08:58:37Z")

</div>

I’m trying to use Supabase API to get a filtered view in Supabase. While I’m able to query the Supabase API with filters in other tools just fine, I’m not able to apply the filters in WeWeb. As the Supabase API docs suggest, I add the filters as query parameters (and, as I learnt in another post, wrapped the object in an array). However, as you can see in the screenshot, the API is called without applying any filters (which results in loading the whole view). How can this be solved?

 ![Bildschirmfoto 2024-07-15 um 10.49.31](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/9/968c205a5ca89772353dbcaf7635c141d1e471b2.png)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [July 15, 2024, 9:28am UTC](https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722/2 "2024-07-15T09:28:26Z")

</div>

Can you send the payload/the query strings from the tab? It’s most likely wrong formatting imo.

---

<div class="post-metadata">

**Author:** ![what.gift](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/what.gift/32/8069_2.png) [@what.gift](https://community.weweb.io/u/what.gift)\
**Post date:** [July 15, 2024, 8:49pm UTC](https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722/3 "2024-07-15T20:49:29Z")

</div>

Can you not just use the built in Supabase Select action in the workflow? I’ve found the filters there can achieve everything I need and that’s a fair bit of nested objects with conditional clauses.

Using the filters on data → collections is more limited.

---

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://community.weweb.io/u/julian)\
**Post date:** [July 17, 2024, 12:38pm UTC](https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722/4 "2024-07-17T12:38:13Z")

</div>

That’s the thing: even though you see the query string that I use in the initial picture, there is no payload (query string) submitted, when the query is executed. There is no payload tab and the preview tab is empty.

 ![Bildschirmfoto 2024-07-17 um 14.36.43](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/de3a079160580a18a407d576ac7ab36467647092.png)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [July 17, 2024, 12:43pm UTC](https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722/6 "2024-07-17T12:43:08Z")

</div>

I think you have the RLS enabled on the table, it usually returns this kind of empty array.

---

<div class="post-metadata">

**Author:** ![julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@julian](https://community.weweb.io/u/julian)\
**Post date:** [July 17, 2024, 12:49pm UTC](https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722/7 "2024-07-17T12:49:16Z")

</div>

I’ve set a security invoker on this view - the underlying tables of the view have RLS activated, yes. So there is no way to load the data via API?

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [July 17, 2024, 1:06pm UTC](https://community.weweb.io/t/supabase-rest-api-not-able-to-apply-filters/9722/8 "2024-07-17T13:06:17Z")

</div>

Security invoker, means that it gets invoked with the rights of whoever invokes it. Meaning that it respects the RLS. If you want to avoid RLS, you need to set it to be security definer.
