Error with live row object

Hello,

I am trying to implement this “plugin” (Token Box and Multi Select DropDown) in my app for selecting multiple items in the dropdown, but I get the following error:

class Upload_file_form(Upload_file_formTemplate):
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)
    self.multi_select_drop_down_1.items = [(r['email'], r) for r in app_tables.users.search(email=q.not_('my@email.com'))]

image

What am I doing wrong?

Thank you in advance.

After opening the clone example in the link, I think the line you wrote here should probably work like:

r['email']
instead of (r['email'], r)

Also, I’m not sure what you are doing with the data binding? Not sure it is needed if it is not being used I mean.

Are the items you would like to see in the dropdown (and ultimately the boxes) the email addresses from the table row search?

1 Like

Yes, it is a column with emails.

Thank you for your reply. It is working.

By the way, I leave here a link to an extra from Anvil that also solves the problem. It’s just great: https://github.com/anvilistas/anvil-extras

1 Like