Query to apply symbology based off field value

1904
3
01-12-2018 04:46 AM
Lake_Worth_BeachAdmin
Occasional Contributor III

I have several thousand points in a web map each with their own symbology category. Is there a way to apply a certain symbology based off a fields value. For example arcade expression:

IIF($Attatchment != "", use this symbol, if it is blank then dont change it)

the field I am inquiring about is attachments. I have users going in the field and capturing images for points. It would be ideal if the field crews could see if that point already has a image attachment associated with it based off its symbology. manually changing these is not feasible.

The source layer for these points is hosted in Arc Server I have access to this on my local machine in ArcMap if that opens any other possible solutions.

0 Kudos
3 Replies
XanderBakker
Esri Esteemed Contributor

When you apply Arcade for symbology you will return values (numbers or strings) that you will base your symbology on. There is another aspect to take into account and that is the fact that the attachment is in a related table, not in the feature layer itself, so your Arcade script does not have access to it (yet, since this will probably be possible in a future release or Arcade). 

You can create a script (and program a scheduled task) that will populate a field (with the count of related attachments or a simple "Yes", "No") that you can use to symbology the data on indicating if a geometry has an attachment.

0 Kudos
by Anonymous User
Not applicable

Howdy!

It looks like you can run some custom symbology logic from the root data (How to symbolize which features have attachments? ) and then should be able to publish up using that symbology logic. 

If that doesn't work for you, you could also have a Python logic that parses the feature's endpoints for the attachment count: Attachment Infos (Feature ID: 298186). You'll probably need some solid experience with Python and XML/JSON parsing, but it could also accomplish what you're looking for.

XanderBakker
Esri Esteemed Contributor

Good one, I forgot that I posted that option... There might be another alternative. Will dive into that and post later...

Edit: I guess you could use the suggestion provided by Nat Carter (see last comment: https://community.esri.com/thread/117274#comment-695968 ) to create two layers and include a definition query and publish those. It works in Desktop and might work in the published service too. 

0 Kudos