Okay, I’m glad to know I’m on the right track, because that’s what I was trying next! Unfortunately it still didn’t work ![]()
I put the code exactly as you said, except that I had to close out the .then((results) part before moving on because it was throwing an error about the await line being inside that (saying it needs to be inside an async function). Closing out that part before it got rid of the red line under await. Other than that, it’s the same.
'use strict';
import wixData from 'wix-data';
import { mediaManager } from 'wix-media-backend';
export async function queryArrayTest2() {
var videoArray = []
wixData.query("AllGuestUploads-Video")
.eq("eventId", "bbfd431b-f957-40bc-89e9-d05c19e6edc2")
.eq("includeInHighlight", true)
.ascending("chapterNumber", "orderInCategory")
.find()
.then((results) => {
let fullUploadData = results.items
console.log("fullUploadData", fullUploadData),
// Create new array for the videoField //
videoArray = fullUploadData.map(({ videoField }) => videoField)
console.log("videoArray", videoArray)
}); // <-- This is the only thing I changed in your code sample //
// GET DOWNLOAD URLS OF VIDEOS //
let urlVideoArray = [];
for (const fileName of videoArray) {
let video = await mediaManager.getDownloadUrl(fileName);
urlVideoArray.push(video)
}
console.log("urlVideoArray", urlVideoArray)
}
And this was my result. The urlVideoArray came first, and was empty. The other two arrays still had results.
And just for clarity, here’s the error it gave me on the await line before I changed the code:

