Combining databases - Transfer multiple fields into one

Dear Community,
After spending almost 2 days browsing the forum and trying it out, I can’t get around asking you for advice:

I’m building a page where different suppliers are listed by their qualifications and products. It shall provide a list, where our partners can gain information about specific suppliers.

In order to enable partners to enter supplier information into the database, there shall be a form. I have created a custom form including necessary information and linked it to the database. No problem so far - really super simple. (Picture for better understanding.)

Each of the suppliers sell different products. The suppliers can also differ in the number of products they offer. The product itself then can come in different package sizes and other attributes. To ensure that names and attributes are always entered in the same way, I have created dropdown menus.


Therefore I have implemented the repeater approaches for dynamically multiple input fields by @yisrael-wix (https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-todomvc + https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-input-repeaters).
The entered data is then stored in another database, temporarily called TempDatabase. That works also perfectly fine so far.
Here is the problem: How do I link the entered data with my supplier database?
A reference field in the supplier database is not possible, unfortunately, because the products have to be deleted from the Temp Database after each entry, otherwise the repeater will prefill itself everytime a new supplier with new products is entered.

Another idea would be transferring all data from TempProducts into a single field in SupplierDatabase. So all information into one Text Input field, linked to the SupplierDatabase, like this, for example
Line1Field1, Line1Field2,…, Line1FieldX \n Line2Field1, Line2Field2,…,Line2FieldX \n… . For this approach, I found only the possibility to connect a database line, such as used for addresses, or first and last name.
Since I am still a real coding beginner, I would need a enlightening keyword on how to realize this.

Maybe you can help me out with a suggestion in that direction?
How can I address an undefined number of database lines one after the other?

Or am I generally on the wrong track with that concept?

Another idea would be using the show/hide method, creating 20 input fields (should be sufficient) and always release the next one on .show, when one has been filled. But firstly, that doesn’t look good at all and secondly, it is far away from best practices.

I hope I have articulated the problem well enough and look forward to your suggestions.

2 Likes