Return result of query as variable

  1. Put the return SumAllVotes inside the then block.

  2. Add return before the wixData.query.

  3. When you call the function, use then like: GetAllSumVotes().then(z => console.log(“SumAllVotes:”,z));