For my customer I am building an application where I query a Featurelayer.
function queryFeatureLayer() {
var query = {
spatialRelationship: "intersects",
outFields: ["*"],
returnGeometry: true,
where: field = value
};
featurelayer.queryFeatures(query).then(function(result) {
// handle results
});
}
This works for a simple attribute field (string) .
Assume field = "animal", value = "dog"
where: "animal" = "dog"
This returns all features that have the string "dog" in this field.
Now the "animal" field is changed to hold a string-list, a domain. In AGOL this gives a popup list with a few animals Assume: ("dog", "cat", "mouse").
I want to query this field but I get errors using:
where: "animal = dog"
or
where: "animal = 1"
The error:
Cannot perform query. Invalid query parameters.
How can I set up a working query to search for all Features that have "dog" set in field "animal" using a Domain string attribute field?
Thanks