Arcade - Return Layer Name (AGOL)

1936
4
Jump to solution
08-23-2019 02:16 AM
DavidFotheringham1
Occasional Contributor

I am looking for a way to return the layer name (as seen in the table of contents) using Arcade in a popup in AGOL.

Reason - I have 60+ individual study areas and when a user clicks on one it would be nice to have the pop up tell them which one it is. Each study area only has 1 feature in it. The attributes do not, currently, contain the study area name.

Solution 1 - add a field for each study area and include the name for easy pop up

Solution 2 - find out if Arcade can do it already

I know solution 1 will work but I am more intrigued to understand Arcade better and see if this is a function exists!

0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi David Fotheringham ,

I was expecting to find a name property on the $layer object, but there doesn't seem to be one. I assume the optimal option would be to work with a single feature layer and the additional attribute to hold the study area for each feature. 

You can use a python script to merge them together and add the additional attribute and publish the feature layer again. 

View solution in original post

4 Replies
XanderBakker
Esri Esteemed Contributor

Hi David Fotheringham ,

I was expecting to find a name property on the $layer object, but there doesn't seem to be one. I assume the optimal option would be to work with a single feature layer and the additional attribute to hold the study area for each feature. 

You can use a python script to merge them together and add the additional attribute and publish the feature layer again. 

DavidFotheringham1
Occasional Contributor

Thanks Xander Bakker‌. Glad it was not just me that could not find a 'name' property. I'll revert back just updating the layers with a 'name' field directly. 

AlexNies2
New Contributor

David,

It is low tec but you can use Concatenate and just type out the layer name.
Example: Concatenate(['Layer Name',$feature.Label], ':')

0 Kudos
dzahsh
by
New Contributor III
GetFeatureSetInfo(GetFeatureSet($feature)).layerName