Passing an Component ID and corresponding Value Dictionary into a Callback function

In my app, I have a lot of the same component types. Is there a way to write a callback that captures the ids and value pairs for all components of the same type and pass the data to the callback function in the form of a dictionary? Ideally I’d end up of a list of dictionaries with the component_id and values for each component.

Not sure what you are referring to with values, but this sound like pattern matching callbacks to mo

Yes I am using pattern matching callbacks. Here is a snippet of what I’m trying to do.

#Submit Callback
@app.callback(
    Output('hidden-div','children'),
    inputs=dict(n_clicks=Input('submit', 'n_clicks')),
    states=dict(
        basepath= State('browse-path', 'value'),
        datainput=dict(iid=State({'group': ALL, 'type': 'input','index': ALL},'id'),
                    ival=State({'group': ALL, 'type': 'input','index': ALL},'value')),
        ddinput=dict(ddid=State({'group': ALL, 'type': 'drop','index': ALL},'id'),
                    ddval=State({'group': ALL, 'type': 'drop','index': ALL},'value')),
        date=State('Date', 'date'),
        tbl1=State({'group': 'tbl1','type': 'tbl', 'index': 'tbl1'}, 'data'),
        tbl2=State({'group': 'tbl2','type': 'tbl', 'index': 'tbl2'}, 'data'),
        switch=State('folder-switch', 'value'),
    ),
    prevent_initial_call=True
)
def submit(n_clicks, basepath, datainput,ddinput,date,tbl1,tbl2,switch):

The above code does not work. I get an error saying the submit function takes 7 positional arguments and none were passed. But even if it did work, I don’t think it will meet my desired result which is to retrieve the component id, value pairs as single dictionary to pass into my callback function.

For reference ddid and ddval represents dropdown ID and dropdown values. I have more than 6 on my dash application which is why I want to use pattern matching callbacks but also retrieve the data as a dictionary to know which dropdown component goes with the values I am retrieving.