Hey,
I'm building my very first website and so far have learned quite a bit.
But not knowing javascript makes it quite challenging to build custom functionalities...
I'm still building basic stuff and I have just done a login page following what the internet was telling me.
Now, I want to do some more and not so much more complex I though...
So, on my login page I have a button ("Profile") that sends the user to his profile page (where he can update his details).
Now I want to add a new button ("Order") that send the user to a page where her will be able to select different items but I want to use some info form the profile to dynamically populate the new page.
In my member profile database I have the used details including his child last name an first name (in 2 separate columns), this db uses the user id as unique key if I got that correctly.
My 2nd database contains the child last an first name and a few more field that I want to be able to populate via the new dynamic page. This db uses the child last and first name as unique key if I got that correctly again.
Now, when I add the onclick function as follow, my query on the member profile db return an empty array and I can't get why that is....
export function button3_click() { let userId = `${wixUsers.currentUser.id}`; console.log("1",userId); $w("#button5").label = userId; return wixData.query("MemberProfile") .eq("_id", `${wixUsers.currentUser.id}`) .find() .then ((results) => { console.log("3",results.items); let childLastName = results.childLastName_1; let childFirstName = results.childFirstName_1; console.log("4",childLastName); $w("#button4").label = childLastName; wixLocation.to(`/MemberOrders/childLastName/childFirstName`); }); }
Hopefully that made sense and someone kind enough to read the whole thing can help me out....
Cheers.
Hey
Correct the following stuff first
let userId = `${wixUsers.currentUser.id}`;
should be
let userId = wixUsers.currentUser.id;