Error on Data Collection getting an item...

Hi,

I get an error on the last line of the following part of my code:

wixData.query(“CrateDatabase”)
.ascending(“title”)
.limit(150)
.find()
.then((results) => {
let itm = ($w(“#input1”).value);
let firstItem = results.items[itm - 1];

		if ($w("#input2").value === firstItem.idSecreto) { 

The error only occurs on the Console when I am on the published WebSite and it says " Uncaught (in promise) TypeError: Cannot read property ‘idSecreto’ of undefined"
Can someone please help me?

Hi, you probably need to sync your data from the sandbox collection to the live collection (edit time data vs. published site data).