How to create autofill based on selection of a dropdown

Hello All,

I’m trying to create a form in which based on a selection from Name dropdown the rest of the input fields should be populated. Basically I’m trying to implement semi-automation. The input information will be flown via API.

if selected == "Request Form":
    with st.form(key='my_form'):
        Patient_Name = st.text_input(label= 'Enter Name'),
        DOB = st.text_input(label= 'DOB'),
        address = st.text_input(label= 'Address'),
        apt = st.text_input(label='Unit/Apartment'),
        city = st.text_input(label='City'),
        state = st.text_input(label='State'),
        zip_code = st.text_input(label='Zip Code'),
        phone_no = st.text_input(label='Phone Number'),
        health_plan_id = st.text_input(label='Health Plan ID'),
        health_group = st.text_input(label='Health Group # (If applicable)'),
        submit_button = st.form_submit_button(label='Submit')

Hi there,

Thanks for sharing your question with the community! Check out our guidelines on how to post an effective question here – in particular, please share a code snippet so we can make relevant suggestions.

This thread will be locked until the original post is updated.

Caroline :balloon: