How do I select a single record from a Supabase collection (filter by ID)

The goal is to select the relevant item from a collection based on the page id. It’s a very basic id = param filter. This is using the official Supabase data connector (dynamic data)

Selecting multiple items works when filtering is not active.

Tried many ways to debug: hardcoding the id, turn the id into a number, ensure that the id used has a matching item, remove row level security, tried to turn on and off pagination, etc.

Not the first time this occurs (had issues with rest api not working and never fixed)

So your records have a field with an array of different page ID’s ? Did you try different conditions in the filter ? Like “is in” or “contains” or something else ?

Otherwise you can also try to store the page id within a variable, and set the collection filter on this variable

Hello @corner thanks for your comment.

I’m using id=[id_value].

The issue isn’t that the page id isn’t working (it is). Even when the id is hardcoded no results are returned eventhough the same sql query done on Supabase works ok. Also when no filter is added, results are shown normally.

Don’t know if this makes sense…

Maybe you didn’t enabled the “ignore when empty” ?

Yes that was it! Seems like I don’t know what that means. There’s always an id in there since it’s hardcoded. Does it mean something else?

Think that it was a caching issue and when the ignore when empty flag was checked, the cache was renewed.

Good to know ! And happy if it works now :slight_smile: