Hi Guys
I am really stuck here and will truly appreciate your support. Basically, I am trying to pass that “field Key” as a parameter in the following code snap: the field key is from a collection/dataset which stores information about artists including a link to the artist dynamic page(which is normally created by the system when you create setup dynamic page) . I wish to fetch the link and use it to open the individual artist page.
export function LoginButton_click(event) {
let username = $w('#username').value;
let passkey = $w('#password').value.r;
wixData.query("Artist")
.eq("title", username)
.eq('StoredPassword', passkey)
.find()
.then((results) => {
if(results.items.length>0)
{
let link = results.items[0].link-artist-1-title; //this is where the problem is
wixLocation.to(link); //system doesn't "-"
} //as show below
else if (results.items.length === 0) {
//$w('#text13').show();
}
})
.catch((err) => {
console.log("err", err);
});
}
the field key is generated automatically by the system when I created the dynamic page (there is no way to change it). I tried to stored it in string and pass
it like this,
let temp = "link-artist-1-title"; //store the string in a variable
then...
ink = results.items[0].temp; //won't work
also you can't passed like this
ink = results.items[0].'link-artist-1-title'; //won't work
I am willing to provide more information upon your request.