I am trying to find a way to update the text of a text element on one of my pages using the result of a wixData query(), eq(), count(), then().
I am trying to assign the result of the query to a global variable declared outside the viewPortEnter function for the text element, but it won't seem to assign. I have put various console.log() methods to print text to trace the execution and I think it isn't executing in the order I would like.
Any ideas on how I could make it possible to update the text of a text element.
To make it more clear, i need:
-To query the database for certain results (three times)
-Use an if statement to determine which count was the largest
-Update the contents of a text element based on the largest count
Any help would be appreciated! <3