Autocomplete with multiple value fields

Hi I am wondering how can I set multiple value fields for the auto complete component.

What I want to do is:

Once that the user has selected the autocomplete value, let’s say email, I would like to insert this info into a database, the problem is that I can only set one value (e.g. email). but I would like to add email, first name, last name and user id.

How can I do this?

Thanks

Juan

Hello,
You can use the autocomplete value to filter a database query and insert the results.

1 Like

All the "auto complete" has is a data source, be it database or API, then a "text" and a "value" so.

  1. Have a database query to only look for the data to use for the Auto Complete which runs on page load possibly.
  2. Have a second database query that queries the users database where the extra info is stored that has a condition of the value of the auto complete
    OR
    • Run a database insert/update with the condition set to the value of the Auto Complete chosen value.

To send the value from the auto complete to the server action use dynamic attributes on changed.
Here is a post I just answered with some of the stuff you will need.

1 Like

Thanks guys, this works perfectly!!! I have been trying to make it work for the past 2 days
Regards
Juan

1 Like