How to set Supabase query limit?

Actions & Logic

Hi, if I add a supaabse query action on page load, I can't set a rows limit. I can set filters and oderdering, but not a limit.

When adding a query to an element or widget like listview, I can add a limit. Unfortunately, it doesn't work when we use query on page load.

I have a page with a clients search engine and I wanted to load the last 10 clients so that the user doesn't have a blank page before they start typing.

Thank you!

What have you tried so far?

I wrote myself a custom action with limit, but I would prefer to use native solutions, here is my custom action, maybe it will help someone.

Future<List<dynamic>?> getLast10Clients() async {
  // Add your function code here!
  final supabase = SupaFlow.client;
  final response = await supabase
      .from('clients')
      .select('*')
      .limit(10)
      .order('created_at', ascending: false);

  return response;
}
Did you check FlutterFlow's Documentation for this topic?
Yes
1
2 replies