Move data between 2 databases

Hello dear Communuty,
after a long time of thinking, I have a premium at 123forms and it works fine. however, now i have a new second database. I have an existing one that is very large. My question is, can I make a mapping between these 2 databases? Database A should always send data to database B?

  • if so can I map certain fields?
    First nameX to first nameY
    AgeX to AgeY

Thank you for your advice

@kenanuenal Are you simply confirming if the database mapping is possible or are you looking at storing/replicating the data in two different databases?
Yes, you map the databases using the reference function, however, the reference function captures the primary field as the base reference ID.
You cannot auto-populate data from A to B as-is. The reference field will let you map the details between A to B and you can showcase the desired output using a table repeater.
I hope I was able to understand your question and was able to be of some help.

You can check if this is useful to meet your requirement:
https://www.wix.com/velo/forum/community-discussion/how-to-insert-a-data-in-two-collection-from-a-form

Do you use a dataset or not?

If you use a DATASET, perhaps this could be a very simple example…
https://russian-dima.wixsite.com/meinewebsite/dublicate-database

Hi Russian . dima :slight_smile:
Nice solution btw…

The copy from left to right works fine, but as soon as I have a user on the right, your tool overwrites the standing user. Is it possible to always add a new record at the bottom?

Plus, my pool on the left should be deleted afterwards, so I know that the relevant users are in the database on the right.

Is then so to speak also a user filter possibility. :slight_smile:

The good ones come from left to right :slight_smile:

Thank you

@kenanuenal
Of course everything should be possible :grin: (that was just an simple example).
I will take a look on it, but this will take some time :wink:

The good ones come from left to right :slight_smile:
I understand :laughing:.

Btw… to remove items you can use …
https://www.wix.com/velo/reference/wix-dataset/dataset/remove

$w.onReady( () => {
  $w("#myDataset").onReady( () => {
    $w("#myDataset").remove()
      .then( () => {
        console.log("Done removing current item");
      });
  });
});

Hello Yulia,

could you already achieve your aim? Already got an solution ?

If not, take a look at your “old-example” :grin: with new features.
Take a closer look onto the “TABLE”, play around with it and try to find out what i am talking about, when i say —> there is a new implemented function in it.

https://www.media-junkie.com/pflegeservice


The feature is still not complete, but already working :wink:

Btw. forgot to mention, that in this version, i did NOT use ANY DATASETS.
(DATASET-FREE-VERSION)

Here we go again…

Improved version available :grin:
https://www.media-junkie.com/pflegeservice

You will find a part of information how to generate code for this feature here…


I think that’s what you wanted to achieve.

Of course everything can be improved, for example the usage of the new functionality —> adding new “list-entry” by DOUBLE-CLICK onto a “table-row”, viewing all selected “values” in a “mini-window” and so on…

How does it work ???

  1. Taking “row-data” from selected table-row (onClick).
  2. Gathering choosen/selected options from CheckBoxGroup-PopUp.
  3. Creating “data-array”.
  4. Converting into JSON.
  5. Storing into —> “local-storage”
  6. Calling the new page → wix-location (wixlocation.to(“”))
  7. Getting DATA back from “local-storage” —> when loading new page (onReady)
  8. Parsing the JSON-STRING back to DATA-VALUE.
  9. did i forgot something? :grin::sweat_smile:
  10. loading data into table (or just using a connected DATASET to the current DATABASE —> “List-Copy”.

That’s it!

export async function btnAddList_click(AUSWAHL) {
 let myArray0 = ["field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10"]
 let myArray1 = []
 let myArray2 = []
 let optionsLength = $w('#cbgListCopy').value.length
    console.log("CopyData: ", copyDATA)
    console.log("Settings-Data = ", settingsDATA)
   //console.log("Settings-Data = ", settingsDATA.items)
   //console.log("Settings-Data = ", settingsDATA.items[1])
 //Prüfen auf Erstauswahl (Checkboxen)
 if (state===undefined) {
 //zeige Auswahlfenster...
        $w('#boxSelection').show('float')
        $w('#btnTitle').label = settingsDATA["setup1"]  
    }

//  var person = {firstName:"Donald", lastName:"Trump", age:50, country:"Bolivia"};
 else {console.log("Auswahl bereits getätigt.")
        console.log("CB-VALUE:", $w('#cbgListCopy').value)
 for (let index = 0; index < optionsLength; index++) {
 if($w('#cbgListCopy').value[index]!==undefined) {console.log("Value-0 = " + $w('#cbgListCopy').value[index])
                myArray1.push($w('#cbgListCopy').value[index])
                myArray2.push(copyDATA[$w('#cbgListCopy').value[index]])
 if(optionsLength=0){myFilter = {
                    [myArray0[0]]: myArray2[0]}
                }
 if(optionsLength=1){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1]}
                }
 if(optionsLength=2){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1],
                    [myArray0[2]]: myArray2[2]}
                }
 if(optionsLength=3){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1],
                    [myArray0[2]]: myArray2[2],
                    [myArray0[3]]: myArray2[3]}
                }
 if(optionsLength=4){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1],
                    [myArray0[2]]: myArray2[2],
                    [myArray0[3]]: myArray2[3],
                    [myArray0[4]]: myArray2[4]}
                }
 if(optionsLength=5){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1],
                    [myArray0[2]]: myArray2[2],
                    [myArray0[3]]: myArray2[3],
                    [myArray0[4]]: myArray2[4],
                    [myArray0[5]]: myArray2[5]}
                }
 if(optionsLength=6){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1],
                    [myArray0[2]]: myArray2[2],
                    [myArray0[3]]: myArray2[3],
                    [myArray0[4]]: myArray2[4],
                    [myArray0[5]]: myArray2[5],
                    [myArray0[6]]: myArray2[6]}
                }
 if(optionsLength=7){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1],
                    [myArray0[2]]: myArray2[2],
                    [myArray0[3]]: myArray2[3],
                    [myArray0[4]]: myArray2[4],
                    [myArray0[5]]: myArray2[5],
                    [myArray0[6]]: myArray2[6],
                    [myArray0[7]]: myArray2[7]}
                }
 if(optionsLength=8){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1],
                    [myArray0[2]]: myArray2[2],
                    [myArray0[3]]: myArray2[3],
                    [myArray0[4]]: myArray2[4],
                    [myArray0[5]]: myArray2[5],
                    [myArray0[6]]: myArray2[6],
                    [myArray0[7]]: myArray2[7],
                    [myArray0[8]]: myArray2[8]}
                }
 if(optionsLength=9){myFilter = {
                    [myArray0[0]]: myArray2[0],
                    [myArray0[1]]: myArray2[1],
                    [myArray0[2]]: myArray2[2],
                    [myArray0[3]]: myArray2[3],
                    [myArray0[4]]: myArray2[4],
                    [myArray0[5]]: myArray2[5],
                    [myArray0[6]]: myArray2[6],
                    [myArray0[7]]: myArray2[7],
                    [myArray0[8]]: myArray2[8],
                    [myArray0[9]]: myArray2[9]}
                }
            }   
 else {console.log("Value-0 = undefined")}           
        }   
        FILTER.push(myFilter)
        console.log("FILTER = ", FILTER)
 //console.log("myFilter-JSON =", JSON.stringify(myFilter))
        local.setItem("copyData",  JSON.stringify(FILTER))
 //console.log("FILTER = ", FILTER)
        $w('#btnAddList').enable()
 if ($w('#cbgListCopy').value.length>0) {$w('#btnShowList').enable()}
    }
}

Of course the OPTION-FEATURE is not a must, it’s just an upgrade to have more flexibility on this interactive example.:wink:

P.S.: It works just in “Table-View” not in “Repeater-View” (yet):grin:.

Test it out and create your new example “COPY-LIST”