How to open a modal and show table of certain records

I’m new to Wappler and am at a loss here…

Setup
I have a data table with 250+ chapters. Each record in the table has a two character state abbreviation field, a chapter name field, and several other fields.

What I want to do
On a webpage when the appropriate state button is clicked I want to open a modal that displays all chapter records only for the desired state.

I have a query built that works using a $GET variable for the state and displays appropriate data for that state on the main page. I’m not sure how to proceed to modify the query (or add a new one) such that it will insert the appropriate state value that comes from the clicked button into a query, opens a modal, and executes the query showing all records for the desired state.

I’ve searched and searched but cannot seem to find the answers I need. Ideally the solution would be in tutorial format, showing step-by-step directions.

Please help!

Thanks.

Assuming that I have understood the setup, the Chapters are the communities or similar and the states are the locations of the chapters.

If that is the case, then follow this procedure.

  1. add a Variable to your document

  2. select the state button and click on Dynamic Events

  3. in the pop-up, select the Mouse Click event

  4. click on the dynamic button

  5. in the pop-up, set the value of the Variable

  6. here I have added some more content to show that when I click on the button, the value of the Variable appears.


You can use the variable to do the filtering of the database that you already have in place.

Add as many button as is required and apply the same procedure for each button.

I just realised that you want to show the records in a Modal.

For each button on-click event, you can add opening the Modal. Use the table Generator to list the records in the Modal.