Reading user input and adding this input to a DataTable to be displayed on the screen

There are two dropdown lists I need to read data from to be displayed in a DataTable. The second dropdown list is only enabled when the user chooses as value from the first one and the submit button only enables when the user chooses one or more values from the second dropdown list.

What I want to do is to take these two inputs and display them in a DataTable when the ‘submit’ button is clicked. With the code below I only read the data input once so every time I do this the data frame changes. Also I defined the main data frame outside the app.callback which might be problematic later.

  '''This array will hold the input values. 
     Ex: array = [['This is list 1 input','This is list 2 input'],
                        ['Another list 1 input','Another list 2 input']]'''
  array = []               
  df = pd.DataFrame(data=array,columns=['List 1 Input','List 2 Input']

  @app.callback([Output('table', 'columns'), Output('table', 'data')], 
                        [Input('button', 'n_clicks')], [State('list1','value'),State('list2','value')])
   def display_selection(n_clicks,value1,value2):
       if n_clicks == 0:
           return None
       df2 = pd.DataFrame([[value1,value2]],columns=['List 1 Input','List 2 Input'])
       df.append(df2) 
       clear_clicks()      #this is a function that sets n_clicks to 0 
       return [{"name": i, "id": i} for i in df.columns], df.to_dict('records')```