Hello, I am very new to dashboards and building data expressions in dashboards.
I have created a data expression to combine multiple layers with identical fields into a single table. However, the category selector I have set up will not work on this table, since it is using a spatial filter.
// load your layers
var featuresets = [
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 31, ["*"], false),
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 28, ["*"], false),
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 34, ["*"], false),
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 35, ["*"], false),
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 27, ["*"], false),
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 37, ["*"], false),
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 30, ["*"], false),
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 38, ["*"], false),
FeaturesetByPortalItem(p, "c756ab8f4b654789812c1b9d6d783640", 32, ["*"], false),
]
// create the output featureset (this assumes that all layers have the same fields)
var merged_fs = {
geometryType: 'esriGeometryPoint',
spatialReference: { wkid: 4269 }, // WGS84
fields: Schema(featuresets[0]).fields,
features: []
}
// append every feature of every input layer to the output featureset
for(var fs in featuresets) {
for(var f in featuresets[fs]) {
var att = Dictionary(f).attributes
Push(merged_fs.features, {attributes: att})
}
}
// and return that featureset
return Featureset(merged_fs)