Hi -
I am working on a data query on a dynamic item page and I am trying to access another dataset. The dynamic item page is linked directly to the Members dataset, and I am accessing data from a Earnings dataset. So, I do the following:
wixData.query("Earnings")
.eq("fullName", "James Lowell")
.find()
.then( (results) => {
items = results.items;
$w("#text18").text = items[0].initialInvestment.toString();
$w("#text19").text = items[0].currentValue.toString();
$w("#text20").text = items[0].profitDollars.toString();
$w("#text21").text = items[0].profitPercent.toString();
})
.catch( (error) => {
$w("#text18").text = "Error";
$w("#text19").text = "Error";
$w("#text20").text = "Error";
$w("#text21").text = "Error";
errorMsg = error.message;
code = error.code;
} );
This is a query that posts results to texts boxes. This query works actually, so there is nothing wrong with this code.
HOWEVER:
When I try to switch the equality parameter to “.eq(“email”, “jalowell”)”, which is another field in the Earnings dataset and “jalowell” is a valid entry, the query does not work. I hope there is an easy fix to this, as it doesn’t seem like it should be terribly hard. Please let me know! Thank you!!