I have attachments enabled on a feature service. I am curious how I could set up a calculated expression so that if attachments exist on my point it auto-populates my PHOTO_TAKEN field to "Yes". If no attachments exist, the PHOTO_TAKEN field is auto-populated to "No".
I haven't tried this since we don't often use hosted feature classes, but my first angle of attack would be using the attachments() function and use a count.
https://developers.arcgis.com/arcade/function-reference/featureset_functions/#attachments
I am using a hosted feature. I published to ArcGIS Online.
This will differ if you are using a hosted feature, and will probably be easier, but to accomplish this in an enterprise deployment we used an attribute rule on both the related attachment table and also on the feature. This means that the "No Photo" will only show up after the edit has been committed, so after submitting if using FieldMaps. See the attachments for the actual code.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.