Hello everyone. I have a working app that includes using a query to return results to a feature table. The feature table shows the number of records returned and selected.
My question is, how can I return the number of records from the feature table in console.log? I am wanting to set up some alerts for end users if the results are 0.
I thought I could dome something like results.length, but that does not seem to be available.
Any ideas? Thank you!
Solved! Go to Solution.
This seems to be the solution I am looking for...
// Gets Records in Console for Feature Table
featureLayer.queryFeatureCount().then(function(numFeatures){
// prints the total count to the console
console.log("Feature Table - Number of Features Returned: ", numFeatures);
});
This snippet of code will return the number of features that are populated in the feature table based on the definition query from the feature layer.
Is it possible to share the code
This seems to be the solution I am looking for...
// Gets Records in Console for Feature Table
featureLayer.queryFeatureCount().then(function(numFeatures){
// prints the total count to the console
console.log("Feature Table - Number of Features Returned: ", numFeatures);
});
This snippet of code will return the number of features that are populated in the feature table based on the definition query from the feature layer.
Good you got the solution !