Collecting Values from Dynamically created Input boxes in Dash

I am working on a dash project, the page has a dropdown menu to select a table, on a selection it displays that table, each table has different columns. You can then press an add row button which creates input boxes dynamically for each column in the table. Upon pressing an execution button I need to fetch the value from these all of these input boxes but this is where I am stuck, I have tried using Pattern-Matching Callbacks but I couldn’t get it to work, when I create the input boxes I do it through a for loop, store them in a tuple and then place that in a dmc.Col() to display them. Any suggestions are greatly appreciated, thank you in advance.

Hello @bggreen1234,

Welcome to the community!

Have you considered AG Grid, I use it for several things similar to this.

Everything becomes a lot simpler because you can use the virtualRowData state as the data that feeds your info. Just loop through the rows and build your entries.

Hi @jinnyzor

Thank you for your response, I’ve just had a look at AG Grid and I’m not sure this is quite what I mean, correct me if I’m wrong but is this for tables and data formatting. I am creating TextInputs and want the value from them rather than from a table.

Nope, the grid is more versatile than that.

When I am done building the entries, I push a button and then dynamically I can pull the data from the rows and do whatever in the backend that I want to.

This can beat having to use pattern-matching which would be my other suggestion for a dynamic amount of inputs.

1 Like

In my application, I’ve set up a dropdown menu that lets users choose a specific dataset table. Once a selection is made, the corresponding table is displayed, each with its own distinct columns. The challenge arises when I press an “Add Row” button, which dynamically generates input boxes for every column in the selected table. I’ve hit a roadblock when it comes to fetching the values from these dynamically created input boxes.