Why you use ASYNC, but do not —> AWAIT?
. then ( async ( result ) => { let psyId = result . items [ 0 ]. _id ; wixData . query ( ‘SubmitReviews’ ) // Return/await ._id from Services to find psychologist reviews. . eq ( ‘medico’ , psyId ). include ( ‘medico’ ) // Include referenced field in the search with ._id. . find (). then ( async ( results ) => {
You even commented it the right way.
Perhaps it is the issue in your case?
then ( async ( result ) => { let psyId = await result . items [ 0 ]. _id