EQS: How to find the AI that is the closest to the player

Is there a way to run the query in the behavior tree instead? And use it as a condition?