Arcade FeatureSetByName limitations?

1205
1
Jump to solution
08-11-2020 01:26 AM
leonoestergaard
New Contributor III

Hi

Is it correct when using FeatureSetByName the layer must be in a featureservice (not a map service) and must be the only layer in the service?

Thank you

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi

That is not correct. You can work with map services, but to have full functionality you will need to add each layer separately. Take a look at the sample service of the USA:

USA (MapServer) 

It is a Map Service with 4 layer:

If you add the service to AGOL using the URL "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer " it will be added as a group layer and functionality will be limited to only the attributes of the current feature.

When you add then individually adding "/0" for the Cities and "/3" for the Counties, you can use Arcade normally to extract the county name for the city like this:

return First(Intersects($feature, FeatureSetByName($map,"USA - Counties"))).name;

Which will appear in the pop-up:

View solution in original post

1 Reply
XanderBakker
Esri Esteemed Contributor

Hi

That is not correct. You can work with map services, but to have full functionality you will need to add each layer separately. Take a look at the sample service of the USA:

USA (MapServer) 

It is a Map Service with 4 layer:

If you add the service to AGOL using the URL "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer " it will be added as a group layer and functionality will be limited to only the attributes of the current feature.

When you add then individually adding "/0" for the Cities and "/3" for the Counties, you can use Arcade normally to extract the county name for the city like this:

return First(Intersects($feature, FeatureSetByName($map,"USA - Counties"))).name;

Which will appear in the pop-up: