double reference. Is it possible?

Is it possible to get items from reference item that has reference. I have
collection x → reference to colection y → reference to collection z

i need query collection x. When i use include i only see x ->y.
Is it possible to see somehow in one result x-y-z.

I believe you have up to 3 levels of reference so it should be ok.

but when i make query with include only firs level appears. How to get second level.
i tried
.include (“level1field.level2field”) in not working

yes it is
let say you have Database1 and Database 2 and Database 3
and you want 2 reference one from Database1 & one from Database 2 to be inserted in Database 3


export function vectorImage1_click(event) {
let toInsert = {
“ReferenceField1”: $w(‘##dataset1’).getCurrentItem()._id,
“ReferenceField2”: $w(‘#dataset2’).getCurrentItem()._id
};
wixData.insert(‘The Database Name You Will Insert In’, toInsert)
.then( () => {
console.log(“Reference inserted”)
})
. catch ( (error) => {
console.log(error);
} );


NOTE : ReferenceField1 & ReferenceField2 === Should be reference fields.
NOTE : You have to add the dataset to your page.