Dropdown in Repeating Panel

What I’m trying to do:
I’m trying to identify whether an event attendee is already a member in my database. I’ve written a Python script that searches through the database and assigns a matching score to each attendee. Each attendee may receive:

  • An exact match, or

  • Up to three possible matches (in cases where they might have used a different email address, nickname, etc.).

In Anvil, I’m displaying this information in a RepeatingPanel within a DataGrid. For attendees without an exact match, I want to show a dropdown menu with their possible matches (based on the score). When I select a match from the dropdown, it should populate the corresponding name, company, and email fields — or work the other way around, where selecting any of those fields updates the others. The selections should be dynamic and stay in sync.

What I’ve tried and what’s not working:
I’ve successfully created the DataGrid and populated it with items from a dictionary. I’ve also added dropdown menus for matched entries. However, I’m struggling to dynamically populate the dropdown per attendee with their individual match suggestions. Also, I only want the dropdown to appear when there’s no exact match, so I can manually review and select the best match where needed.

Clone link:

You can control whether the dropdown appears or not with it’s visible property, so you can check with an if statement whether the attendee has possible matches and set the dropdown.visible property to True or False respectively.

You can assign the attendee’s possible matches to the dropdown’s items property. More specifically, you can assign a list of strings (e.g., the possible matches’ names or ids) to dropdown.items.

Then you can set the dropdown’s change event handler to a function that uses the value (name or id of the possible match) to get all the info for that possible match (e.g., from a dictionary or table row) and populate the corresponding fields with that info.

Does this help?

2 Likes