Select to view content in your preferred language

Arcade - return layer name alias/ display name or decsription

377
3
09-30-2024 03:21 AM
Labels (1)
cat206
by
Frequent Contributor

Hi,

I've recently found the arcade GetFeatureSetInfo(GetFeatureSet($feature)).layerName, however I am after getting the alias name or item description rather than the layer name - see screenshot for clarification, I would like to grab the green square rather than the red one

Does anyone know if this is doable please?

 

cat206_0-1727691621051.png

 

0 Kudos
3 Replies
RPGIS
by
Frequent Contributor

Hi @cat206,

GetFeatureSetInfo(GetFeatureSet($feature)).layerName does not need the GetFeatureSet. Simply having the $feature or using $featureset will do the trick.

The other thing is, have you tried using console to see what it prints out because it should return the layer name only. If there are characters in the name that you don't want, then you can simply use split text function, which returns an array, and then select the first index of that array to get the name.

0 Kudos
cat206
by
Frequent Contributor

Thanks for the response and the tip! 

The feature layer is fed by a python script scheduled to run each day, which truncates and appends the data. We therefore can't amend the layer name, which is what the GetFeatureSetInfo grabs in the console. The alias and description is updated by the python script to say the last date and time the layer was updated, therefore it'll change daily. When adding the feature layer to a map, the alias doesn't get updated in the content as it's static, so i wanted to add an arcade expression to grab this info into the pop-up. I hope that make sense but looking at the arcade documentation, there doesn't seem a way to obtain the alias FeatureSet functions | ArcGIS Arcade | Esri Developer

0 Kudos
RPGIS
by
Frequent Contributor

Hi @cat206 

If you are using a python script then simply add a field that you can populate with the arcade expression and use that instead. I have used that method before.

0 Kudos