Dropdown None bound value -> select placeholder

What I’m trying to do:
I’m trying to make a dropdown select the placeholder value if the bound value retrieved from the db is None

What I’ve tried and what’s not working:
TBH I think this should be default behavior.
Tried to do it manually like this but it doesn’t work:
Code Sample:

def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.details = anvil.server.call('get_user_details')
    self.init_components(**properties)
    if self.details['my_therapist'] is None:
      self.my_therapist_dd.selected_value = self.my_therapist_dd.placeholder
    # Any code you write here will run before the form opens.

Can you even manually select the placeholder?

I think setting the selected value to None should do it.

Okay, so MANUALLY setting it to None works but leaving it just bound to a value that’s none displays . I think that might be a bug. Thank you.

Worth providing a minimal example that demonstrates the potential bug and we can look into it.

1 Like