Sorting reference field

i cant sort via reference field in Editor so i have code for it. But nobody can help me to tell how can i sort it via reference field. It should be easy but i have no idea. Please tell me.

$w.onReady( () => {
$w(“#dataset2”).setSort( wixData.sort()
.ascending(“lokalizacja”)
.descending(“here i want value of reference field called pokoj not ID”)
)
.then( () => {
console.log(“Dataset is now sorted”);
} )
. catch ( (err) => {
console.log(err);
} )
});

1 Like