Ian,
Your callback function can be a named function instead of an inline callback function like you have. That way you can check the query results for records and if there are none then you would like you said call the named callback function.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.