Condition not working


I have a simple query to check if a record exists.
Run a query to check for record
Condition - is there a record? query.length
If yes, run insert query 1
if no, run insert query 2

It always runs insert 1 even if no record exists. Am I missing something simple?

Community Page
Last updated: