I am creating a widget that adds several layers on the map but before I add a layer on the map I want to make sure that the query associated to the layer does not return an empty set.
I have found an example using QueryTask to get data but this for the ArcGIS API for JavaScript. I have tried to include the code within my widget but it never gets to the showResults function in my attached file.
Here is my environment:
- Portal for ArcGIS version 10.6
- Web AppBuilder Developer Edition 2.6
- ArcGIS JavaScript API 3.33
Is there any way for me to check if the query associated to a layer will be empty before I add the layer to the map?