AGOL webmap pop up using ALIAS instead of FieldName

520
5
Jump to solution
10-05-2023 06:38 AM
MariusBartašius
New Contributor II

How could I use feature class using ALIAS instead of FieldName in pop up AGOL?

 

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

How is your popup configured?

A "field list" element should use the alias by default, and an Arcade element is totally in your control as to what is displayed and how.

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
5 Replies
jcarlson
MVP Esteemed Contributor

How is your popup configured?

A "field list" element should use the alias by default, and an Arcade element is totally in your control as to what is displayed and how.

- Josh Carlson
Kendall County GIS
0 Kudos
MariusBartašius
New Contributor II

I don't know, but for me it doesn't. It shows field_name instead

 

Screenshot 2023-10-06 082701.png

0 Kudos
KenBuja
MVP Esteemed Contributor

You can get the alias of the field by first getting the schema of either the feature or layer.That returns a dictionary of the fields and their names, aliases, types, and other information.

In this example, I'm constructing a list of the field aliases for fields that contain the word "MAX" in the field name and have a value of one.

var theSchema = Schema($feature);
var fields = theSchema['fields'];
var species = [];
for (var i in fields) {
   if (Find('MAX', fields[i]['name']) > -1 && $feature[fields[i]['name']] == 1) {
     Push(species,fields[i]['alias']);
   }
}

 

0 Kudos
MariusBartašius
New Contributor II

And what would be expression if simple I want to use Alias, without loooking for specific word.

0 Kudos
KenBuja
MVP Esteemed Contributor

Can you give an example of what content you would like to see in the popup?

0 Kudos