Dynamic Dropdown Lists - Supabase Query / API

Hi all,

Currently working on my Windows Application using the following:

  • Flutterflow - UI for creation/programming.

  • Supabase - For the backend of the application/database/storage.

I'm struggling with one page on my application, a data entry page for users to complete which will then store the data in a table.

I have two dropdown fields created:

  • Year Dropdown - This dropdown allows a user to select the 'Year' in which they are entering data for.

Current columns/fields for the 'years' table.

yearid (uuid) - Unique id, used as foreign key for 'periods' table.
year - (int4) Column for the year name.
isopen - (boolean) Sets whether the year is open to write data too. True = Open False = Closed

When a user comes to use the 'Years Dropdown' it should only list 'years' that have the 'isopen' set to true.

---------------------------

  • Period Dropdown - Allows a user to select the period that they are entering data for.

The table that stores the 'Period' information is called 'periods':

Current columns/fields:

periodid (uuid) - Unique id.
yearsid (uuid) - Used as foreign key to link the 'years' and 'periods' data together.
period (text) - Lists the names of the periods.
isopen (Boolean) - Sets whether the current period is 'open' = true, or 'closed' = false.

The end result:

This application essentially is for logging data, multiple years and periods can be open at anyone time.

I'm trying to restrict users from entering data to the database once years/periods have been closed.

Year Close - Once all data for every period has been entered, the periods are closed and when the last period 'Period 14' has been processed, the year can be closed.

Period Close - At the end of a period, the period is closed and the next period is opened.

Essentially if i select 'Year' 2023 from dropdown '1', only periods: 12, 13 and 14 should be displayed in dropdown '2'. (Based on the current information in the database.)

What do i need?

Can anyone help me to achieve making this work? I've struggled for a few in days trying to implement this through the UI using 'backend queries/API queries'.

I'm still learning flutter and Dart, as well as flutterflow, so i've not managed to make this happen using 'custom code either'.

If anyone can provide advice, step by steps, tutorials, anything. (This may be something really easy for someone else!)

Thanks for taking the time to read and sorry for any spelling mistakes.

1
2 replies