Select to view content in your preferred language

FeatureSet with Geometry

276
8
4 weeks ago
Labels (1)
clt_cabq
Frequent Contributor

I have a list in my dashboard based on a data expression that counts the number of locations with the same address, then I use advanced formatting to color the background of list item based on the frequency that address occurs in my data source. I can then filter the map when a list item is selected, but the map will not also zoom to the location. Is there a way to make this happen? 

8 Replies
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

Hi @clt_cabq,

What map actions have you set on the list. If you set it to filter by the same field and also set it to zoom in then it should zoom in. There could be the possibility that there could be an error in one of the addresses which might also affect the filter and zoom.

0 Kudos
clt_cabq
Frequent Contributor

When I have it set up as I do, the only action that is available is the Filter option. The list is based on the same layer in the map so its sort of two instances of the same object.

clt_cabq_0-1752161516501.png

 

RPGIS
by MVP Regular Contributor
MVP Regular Contributor

Hi @clt_cabq,

Is your data able to be filters correctly based on the list. If it is able to filter but not zoom then one thing you can try is to create a new featureset in the data expression and use that to filter.

0 Kudos
HollyTorpey_LSA
Frequent Contributor

I'm having the same issue. I figured that I needed to include the geometry in the featureset created by my expression, but so far I haven't fully succeeded. I did get to the point where the zoom/pan/flash actions reappeared, but they still didn't work so I suspect there is still an issue with my geometry (like it's there, but it's null or something). If I figure it out, I'll let you know.

- Holly
0 Kudos
clt_cabq
Frequent Contributor

This is my Arcade, I think i need to get the geometry into the attributes of the featureset I'm returning but unsure if that will work even. 

var compFeats = Filter(FeatureSetByPortalItem(Portal('https://arcgis.com/'),'arcgis item number',0,['REFERENCENUMBER','CREATEDTIME','CATEGORY','ADDRESS','DESCRIPTION'],true), "CREATEDTIME > '05/31/2025'");
var tempGrp = GroupBy(compFeats,['ADDRESS'],[
  {name: 'TotComplaints', expression: 'ADDRESS',statistic: 'COUNT'},
  {name:'InitComplaint', expression: 'CREATEDTIME', statistic:'MIN'},
  {name:'LstComplaint', expression: 'CREATEDTIME', statistic:'MAX'},]);
console(Count(tempGrp))
return tempGrp

 

0 Kudos
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

Hi @clt_cabq,

So the groupby function returns a different featureset and that featureset doesn't include the geometry. To return a featureset with the geometry you'll need to configure it to match the example below. 

var featfields = [{name:"A", alias:"alias", type:"esrifieldType"}]

var attvalues = [{attributes: { "A" : "a" }, geometry: "the feature geometry or intersection of feature geometries"}]

var egeometrytype =  "esrigeometryType[Polygon,Point,Polyline,etc.."]

var fs = { "fields": featfields, "geometry":egeometrytype, "values":attvalues }

return Text(Featureset(fs))

0 Kudos
clt_cabq
Frequent Contributor

Thanks @RPGIS I'll fuss with this a bit today, I had figured it was something along these lines, I'll report back when I've tested! 

0 Kudos
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

Hi @clt_cabq,

If you're are having difficulties feel free to let me know and I'll write the code that will work, or at least get you close, to what you're trying to accomplish. 

0 Kudos