Dynamic callback to support n inputs

Hey all,

I am currently working on an app where I dynamically create n divs each with their own unique id where I would then like to use the input from these divs in a callback.

My code to generate the containers works perfectly and now that I’m ready to take information from those divs in a callback I have realized that it may not be possible.

Is there a way to create a dynamic callback such that one callback can read how many divs I created and then call a callback specific to the id’s associated with those divs?

Imagine my app will be used to generate statistical distributions where a user inputs a number 1 to 10 and then that many rows are created with various fields for user input. Once the user is ready to generate the data they press a button, etc.

Hi @theRealDavidDavis,

Welcome to the community! :slightly_smiling_face:

Please take a look on Pattern-Matching callbacks: Pattern-Matching Callbacks | Dash for Python Documentation | Plotly

It is not clear to me from your description if you need a pattern with ALL or MATCH, but please follow up if you face any issues implementing it in your case.

Hope this helps!

1 Like