Need Help Matching Dropdown Selections to IDs from Supabase Backend in FlutterFlow

Database & APIs

Hi FlutterFlow Community,

I'm new to FlutterFlow and need some guidance on matching elements from a Supabase backend query "List rows."

Here's my situation:

  • I'm using a "Dropdown" component linked to a Supabase table named "sports." This component allows users to select a sport, which corresponds to the "name" field in my table.

  • When a user selects a sport, I need to retrieve the corresponding ID from the "id" column to use it in another component. For example, if the user selects "football," I need to get the corresponding ID of this sport.

What have you tried so far?

I've found a solution, but it feels a bit clunky and possibly illogical:

  1. I use an action block with two steps.

  2. In the first step, I perform a backend query that filters the rows based on the user's sport selection.

  3. In the second step, I update an App state with the result of the query from the first step.

This works for now because my table has only three rows, and all names are unique. However, I'm concerned about the scalability and reliability of this approach if I need to apply it to another table where the filter might not guarantee the correct row and ID.

Could anyone suggest a more efficient or logical way to achieve this in FlutterFlow?

Thank you!

Did you check FlutterFlow's Documentation for this topic?
Yes
2 replies