Sync fields between data collections

Hello
I have a data collection with a list of names and last names.
one of my pages is form and one of the form fields is the names from the database, that form is updating another database.
I’m taking names from database x and inserting them into database y, in database y there is names and other stuff from the submission form.
my question is, when user is picking the name from the drop down menu and updating the form fields, how can i fetch automatically the last name from database x and insert it to database y?.
when user is picking first name and hit submit, the last name will be updated as well between the data collections, is it possible?.

Thank you.

Meirh,

It is possible to do, and there would be more than one way to go about it. You might include some screen shots of the two collections that you are using to give us a better idea what you are working with. In the meantime, have a look at this article and these documentation pages.

https://support.wix.com/en/article/displaying-content-from-multiple-database-collections-using-reference-fields-4034931
https://www.wix.com/corvid/reference/wix-data.html#insert
https://www.wix.com/corvid/reference/wix-data.html#update

Thank you, i will check the links and will update.