Return result of query as variable

Done, for this command:

GetAllSumVotes (). then ( z => console . log ( “SumAllVotes:” , z ));

the error is:
There was an error in your script
TypeError: Cannot read properties of undefined (reading ‘then’)