How to Display user_id in a Searchable Dropdown for Update in Wappler?

Hi Wappler community,

I’m currently building a user management system in Wappler and am facing an issue when performing the update operation. I need to display a searchable dropdown where the username is shown, but the dropdown should also be pre-populated with the user_id when updating a user’s details.

Here’s a breakdown of what I want to achieve:

Problem Description:

  1. When adding a new user: I have a searchable dropdown that shows the list of users. This works as expected. I can select a username and store the user_id when creating a new user.
  2. When updating an existing user: I need to ensure that the dropdown shows the correct username based on the existing user_id from the database. The challenge I’m facing is:
    When updating, I want the user_id to be selected and visible in the dropdown, but I don’t want the user to change it.
    I want to use a searchable dropdown (using Select2 or similar) and show the username but pass the corresponding user_id in the form.

Any suggestions on how to solve this issue?