Hi,
I found this script to extract the name from a wix user dataset and display it in a text field. Now I want this name to be used in another dataset. This script I have shows the name but does not write it to the new dataset....
When I test it does the name also disappear when saving the data? How can I solve both of those?
This is the script I'm using now:
import wixUsers from 'wix-users'; import wixData from 'wix-data'; $w.onReady(function () { wixData.query("Members/PrivateMembersData") .eq("_id", wixUsers.currentUser.id) .find() .then((results) => { $w('#text10').text = results.items[0].nickname; }) });
Dataset1↓
Dataset2↓
Mixing wix-data with datasets and setting inside of property-panel --> IS NOT A GOOD IDEA! ! !
Either go the one way, or the other.
Mixing both always ---> ends in issues!
And what exactly is a --> DATASET ???
Did you ever ask yourself this question?
a) Is it something what can hold data inside?
b) Is it something what has the functionality of somekind of a --> "data-wire" <--- between your DATABASE and your elements on your page?
c) Can a dataset survive without a --> DATABASE in the background?
d) Is it something you can eat?
So first try to understand the functionality of a dataset and then ask yourself your own question one more time...
How to put data into a dataset? Is this possible? Where do the data go to?
How do you start your saving process?
Do you have a code for the SAVE-ACTION?
Or did you just simply connected your button inside of propertypanel?