How do you display repeating table records based on a drop down selection?

HI

I am stuck on trying to figure this out and need some pointers.

I have two tables called “Project_list” one record to many “Records”.

Project_list

  • id
  • Name
  • description

Records

  • Id
  • project_list_id (foreign key)
  • name
  • details
    *some more details

The drop down shows project “Name” from the “Project_list” table available which only one can be chosen from.

On selecting the project list from the drop down I want to display only those from the “Records” table in a repeating table which correspond with the selected “project_list_id”.

I know how to set up a server connect to run a query to pull in say a hard coded project list id, but how do I make this dynamic repeating table based on a drop down selection as described above?

Many thanks!

Create a $_GET variable for your second server action and use it to filter by project list id in the query builder.
Then on the page bind your select value to this get variable for the server action. When the value of the select changes, it will filter your database query.

1 Like

Ah ha. I missed the Get variable input on the front end.

Cheers!

1 Like