How to Query one database to create a record in a second database

Hi, I’m trying to use one database to store customer info, and a second database to store records for each customer.

Let’s call my first database ‘Customers’. I have a form for the customers to fill out personal information. How do I make it that every entry will generate a unique ID since other keys such as name are not unique.

I want to link this to a second form and database, called ‘Records’. I would have a separate form (that only I would access), where I can search for the specific customer I want to make a record for, and then this entry in ‘Records’ would be linked to the unique customer ID.

For example, in the second form, I would search John Smith as the name, and it would display in some drop down all John Smiths from Customers (along with some other fields to differentiate). I would select the John Smith I want to create a record for, and fields I fill in would be recorded in ‘Records’ for this customer.

How should I design this?

Create your data collection Records, add a reference field like customer and link that to the Customer data collection. Then make your page accessible for admin role only. Add a data set to the page from Records. Add a drop down with value connected to the reference field. Make it write only if that is what you want. Add a button connect it to submit.

now you can add records for any customer