I am not experienced in coding and would appreciate some guidance with the following:
I have to run two different wixData queries and i would like to store the results in a variable. The problem is that I cannot use this variable outside the wixData.query. Question: What is the best way to store the outcome of query1 and use the outcome in query2?
Here’s my code as an example (Dest1 is filled in the first query). I would really like to know how to fill variables and use their value outside the query code.
Thanks, but this unfortunately doesn’t work either. The value of the variable doesn’t get updated. I read on other community posts that this is due to asynchronous processing and any code should be put right after .then((results)
However, I don’t see how this can work if the code after .then((results) requires a result from a previous query.