Clear Dropdown Command

Hello all, glad to be onboard and eager to help in the forums like you guys are doing.

What I’m trying to do: I need to clear drop-down selected values after submitting a form.

What I’ve tried and what’s not working: I have tried setting the value of the drop-down to “” but I receive an error saying that is not an available value.

Code Sample:
def clear_inputs(self):

self.drop_down_area.selected_value = “”
self.drop_down_processo.selected_value = “”
self.drop_down_fatores.selected_value = “”

Clone link:
https://anvil.works/build#clone:OLGK665WURFGJTGR=AX3FUELE7TEFNTLAGHVI42XF

Hi @cevh.81 and welcome to the forum.

Try setting it to None and make sure you’ve included a placeholder.

3 Likes

Thanks @stucork for the welcome and solution!

Actually what worked for me was setting up a Placeholder (aka empty line dropdown option) and then on code setting the dropdown value to “”

I could not figure a placeholder for None but question solved :slight_smile:

1 Like