How to Implement a Feature to Select Language and Proficiency Level with Wix Velo and Save to User Profile

I’m working on a Wix site and want to create a functionality using Wix Velo (Corvid) where users can select a language and their proficiency level in that language from dropdown lists. The languages and proficiency levels are stored in separate Wix Data collections named Languages and LanguageLevels, respectively. I also have a UserLanguagePreferences collection to save the user’s choices, which should be linked to the user’s profile stored in the Register collection.

Here’s what I aim to achieve:

  1. Load Languages and Levels into Dropdowns: On a specific page, users should see two dropdowns. The first dropdown (#dropdownLanguage) will list languages from the Languages collection. The second dropdown (#dropdownLanguageLevel) will list proficiency levels from the LanguageLevels collection. How do I dynamically load these options into the dropdowns when the page loads?
  2. Saving User Selection: Once a user selects a language and a proficiency level, I want to save this selection to the UserLanguagePreferences collection upon clicking a “Save” button (#saveButton). Each entry in UserLanguagePreferences should link to the user’s ID from the Register collection, the selected language, and the selected proficiency level. How can I efficiently capture and save these selections?
  3. Linking to User Profile: After saving the language and proficiency level to UserLanguagePreferences, I need to ensure this data is associated with the specific user in the Register collection. Ideally, this linkage would enable displaying the user’s language choices, including the proficiency level and language icon, on their profile page dynamically. What is the best approach to link these collections and display the selections on the user profile page?

Could you provide guidance or examples on how to implement these functionalities using Wix Velo? Specifically, I’m looking for advice on dynamically loading dropdown options, saving user selections to a collection, and linking these selections back to the user’s profile in an efficient manner.

  1. You can do this with Datasets. If you want to do it specifically from Velo then use the wix-data library to .query().find() the data you need and the Dropdown options property to set it in the Dropdown element.
  2. This can also be done with Datasets. You’ll want to make the Dataset read-write. But if doing this with Velo you can use wix-data’s .save() or .update() functionality.
  3. This can also be done with Datasets or wix-data using what’s mentioned above. If using Velo you can learn about how each type of element works here: Wix Editor Elements ($w) - Velo API Reference - Wix.com