Hiding errors while waiting input data

Hello all!

I want to ask how I can hide error message while waiting for input from the user.

I’m asking the phone number of the user and based on this data I proceed to the next questions. When I first run the program the following error is shown. I want to hide it:

phone = st.text_input("Phone number:")

query = {
"query" : {
"field" : "phone",
"operator" : "=",
"value" : phone
} } 
url = "https://api.intercom.io/contacts/search"
result = r.post(url, headers=headers, json=query)
result = result.json()
courier_id = result["data"][0]["id"]

st.text("Please select the regions that you prefer to work in. You can choose more than one region.")
regions = st.multiselect('Choose your regions', ['R1', 'R2', 'R3', 'R4'])

Thanks in advance

Hi @eliflem , if I understood you correctly , how about adding a condition,

# The text input box is not empty then only you proceed 
if not phone:
1 Like

yes it helped! Thank you so much

1 Like

Glad it worked :slight_smile:

1 Like