I am trying to place a value from a dataset into a URL and navigate there with an onClick event. The button isn’t working though. Any idea what I am doing wrong here?
export function image1_click(event) { let item = $w(“#IRISid”).getCurrentItem(); let vID = item.username;
wixLocation.to(“/interface/patients/” + vID);
}
First be sure to import wixLocation.
Second, be sure that the dataset is ready before you retrieve the item.
Third be sure you have such a dynamic page.
From which you can see how to setup commands to take the user to their own unique profile page like in this code example here/ export function profileButton_click(event) { wixLocation.to(/Members/${wixUsers.currentUser.id}); }