Hi,
I am attempting to create a function that will dynamically create text_inputs for a many fields as there are in my database table. What is the best way to go about dynamically adjusting the number of text_inputs and then recording the value in each input. The way I have my code set up, I’ve successfully created the multiple inputs, but I have no clue how to refer to each of the newly created inputs.
def cols(db,s_box):
fields =[]
exclude = ['notes']
cursor = db.get_collection(s_box).find({})
for item in cursor:
for i in item:
if i not in exclude:
fields.append(i)
s_stat(i)
st.sidebar.text_input("Please enter a seach value for {}".format(i),on_change=s_stat,key=i)
confirm = st.sidebar.button("Search Database {}".format(s_box))