Is it Possible using the Supabase Select function to pass a dynamic value?

Hi all,

I’ve figured out how to create a Supabase view called “countImages”, and I see when setting up a WeWeb workflow with the “Select” function that it’s something I can choose.

My question is, does a view let you pass a dynamic variable?

This is my query in Supabase

I want the number (where it says 24) to be a dynamic variable. Is there a way to make that dynamic, and if so, does it show up as a field I can input (in the earlier screenshot using Select)?

If I can’t do it through the native Supabase plugin that WeWeb has, how would one do it?

You need to apply it as a filter on the collection in the collection setup

You can do fairly complex filter setups with conditional groups of conditions. It’s great

That’s true, but I’m assuming there’s a speed loss with doing it in WeWeb vs Supabase?

My data collection is relatively small, but from what I can tell WeWeb still requires you to output the list of values (even if for eg, I just say return all IDs) so I’ve have to return that array and then wrap it in a length() function.

As opposed to just doing the COUNT function straight in Supabase?

Again small datasets, I assume speed is negligible, but I’d imagine larger datasets would see a noticeable difference in speed

Regardless, you’ve pointed me in the right direction, so thank you!

1 Like

Brilliant, that’s good to hear! I’ll mark your video as the solution as it pretty much serves my current use case.

Turns out in a workflow I don’t have to do a length() function to get the COUNT of items in the array, so that’s pretty sweet.

image

Good to see how hectic you can get with filters. That’s a pretty impressive setup you got there as well as a nice looking UI! Excited to see how far I can push my limits on WeWeb :slight_smile:

2 Likes