Hello,
I am configuring a dashboard where I used a list widget and would like to display the right icons besides the listed features.
I have used arcade coding to get the output of this list which is derived from one of the feature layers used in the web map present in my dashboard. I am aware that to get the list icons, one can simply choose Configure>List>Line item icon>Symbol. But this way, my list widget is not able to draw the right symbology of the feature layer (red colored circles) as shown in the screenshot below instead it just draws the default ArcGIS symbology for point geometry (reddish-orange-colored circles).
Is there a way to directly the fetch the symbology/icon from the feature layer into the list widget, maybe through advanced formatting or so?
I don't think you can. In Arcade, Feature and FeatureSet objects don't include any information about the symbology. In general, the feature icon is useless for Data Expressions.
However! Depending on how complex your symbology is, you can use Advanced Formatting and SVGs to recreate your icons in the list, that way each feature can have a data-driven symbol that updates with the layer. More tedious to set up, but definitely doable. I can dig up an example if you like, but similar posts are here on the Community already, and you could probably find them with a search.
Thanks @jcarlson . As per your suggestion, I just tried advanced formatting in the List widget using SVG code but could not get the desired result. Below is my code. Could you please take a look to suggest any improvement(s)?
Please note: I am trying to display only one icon (red colored circle) which is associated with one of my fields in the attribute table. The name of the field is 'OutbreakStatus' which can have only two values - 'Yes' or 'No'. The output of the List only includes 'Yes' values for the 'OutbreakStatus' and hence the icons of those outputs should be all same and show only red circles.
Oh! If the icon is the same for each row, you don't need Arcade at all. In the line item template, click to view the source and just drop in your <svg>...</svg> tags. You'll probably need a couple of divs to get them aligned nicely.
Thanks @jcarlson for sharing your idea. I did exactly the same as you suggested but still cannot see the desired icon instead only the default icons.
Hello @jcarlson . I was wondering if you had a chance to look into my latest reply to this post.
Thanks in advance.