Using ArcGIS JavaScript API 4.24 and uniqueValues from esri/smartMapping/statistics/uniqueValues I am able to get Count of all features in a FeatureLayer (fcLayer in this code)
In this example respond is based on AppType field from fcLayer
uniqueValues({
layer: fcLayer,
field: "AppType",
}).then(function(response) {
let infos = response.uniqueValueInfos;
infos.forEach(function(info) {
console.log("Application Type: ", info.value, " are: ", info.count);
});
});
Now Can you please let me know how I can robust this code in a way that I can group and query two fields AppType and AppStat instead of field: "AppType" only?
I tried to use sqlExpression and sqlWhere instead of field option like
sqlExpression = "AppType = 'RD' AND AppStat = 'active'"
sqlWhere = "AppType = 'RD' AND AppStat = 'active'"
in the code like
uniqueValues({
layer: fcLayer,
sqlExpression = "AppType = 'RD' AND AppStat = 'active'"
}).then(function(response) {
or
uniqueValues({
layer: fcLayer,
sqlWhere= "AppType = 'RD' AND AppStat = 'active'"
}).then(function(response) {
But none of them returning any thing!
