Hello community, please help me, I am trying to get data from “multi-refenced”, but I am not getting it in the same order that they are saved (attached image), I have also tried to include the function “sort ()” and not I have obtained results. According to the Wix Api documentation WixDataQueryReferencedOptions should it work, or maybe it is misspelled? Please help me with this problem or maybe I can change my code to get a favorable result for what I am looking for. Thank you!!!
https://www.wix.com/corvid/reference/wix-data.html#WixDataQueryReferencedOptions
wixData.queryReferenced("myItineraries", itemId, "myItinerariesList", options)
.then( (results) => {
console.log(results)
if(results.items.length > 0) {
let items02 =results.items;
let order= items02.sort(); //same order that items02
let numItems= results.items.length + 1;
console.log(items02);
console.log(order);
for(let i =0; i < results.items.length; i++ ){
items03[i] = { _id: (i + 1).toString(),
title:items02[i].title,
description: items02[i].header,
country: items02[i].country,
image:items02[i].image1,
Id:items02[i]._id
};
}
$w("#repeater2").data = [];
$w("#repeater2").data = items03;
} else {
console.log("error de carga edit")
}
} ).then(()=> {
// $w("#repeater2").show();
} )