Help with server action record count problem

I am trying to return the number of records found by a simple data query in server connect.

Her is the code
image

The variable reccount correctly returns the number of records if records are found but not in the event of no records being found

I added .default(0), so using {{query1.count().default(0)}}, to try and force the return of zero but it is not being returned. I have also tried testing for null but that does not appear to be the solution. Any ideas on how to resolve this
Any one know what is begin returned or it is simply not initialised?

What i actually want to do is as below, i just cant get it to work. The redirect does not take place and no errors are shown in the developers console. Sure i must be missing something obvious

image

Any suggestions appreciated

Community Page
Last updated: