Select to view content in your preferred language

Configure popup using Arcade to filter attributes

555
1
04-18-2023 01:36 AM
CherylWheeler11
Occasional Contributor

I have amalgamated some datasets and now have a multitude of attributes, some of which are not relevant for all features (many more than in the below example 😕). I am looking for a way to filter the attributes in the popup using an Arcade expression. For example, referencing the table below, if a user selects a feature on a map and the value for the ‘Layer’ field is ‘A’, then display all attributes with ‘A_’ as the prefix. Similarly for all other values of ‘Layer’. So, for a feature selected which has a value of ‘B’ for the Layer attribute, the attributes ‘B_abc’ and ‘B_def’ would be shown in the popup.

 

I feel this can be accomplished using Arcade, but I cannot get my head around how.

 

 

Layer

A_abc

A_def

B_abc

C_abc

B_def

A

Xyzxyz

pqrs

 

 

 

B

 

 

Mnop

 

Defgh

A

Xyz

Vwx

 

 

 

C

 

 

 

xyza

 

C

 

 

 

pqrstu

 

B

 

 

pqrst

 

Jkl

 

Thank you for any pointers.

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

You can use variables when getting a field from a feature. Here's an example, using the Popup profile in the Playground.

 

var field = 'UPDATE';
return $feature['LAST'+field]

field.png

0 Kudos