I am very new to Arcade and having a lot of trouble trying to write an expression. I have a Survey123 form that users are filling out. It shows if a valve is open or closed, and one valve can have many entries based on when it was surveyed.
The fields that are relevant are ScanAssetTag (valve id), OpenClosed (status of valve), and CreationDate (when survey was completed).
I was wondering if there was a way to use an Arcade expression to evaluate which valve has the most recent date and then symbolize only that point, and show if that valve is Open or Closed.
I found this thread which is sort of what I'm looking for, but I can't use the FeatureSetName function because those are only for popups and I'm writing an expression for Style. Also, I don't know if I'm able to create a new field to visualize valve status using numerical values.
Thanks!
Unfortunately, you would need the field(s) for your expression to be in the main table. You can't access other tables from the Symbology profile. There's a good reason for that, too! Calling up related records is an extra call to the service, and the symbology profile evaluates for every feature in the map's display. If you had many thousands of features visible, you would be absolutely pummeling the server every time you moved the map around, and your map would likely be quite slow.
Using a FeatureSet function in a field calculation on the other hand, is quite doable. You could create a new field on your valves layer and then use an expression to populate that field based on the most recent survey.
If you use something like Power Automate or Make, it's possible to use a webhook to update that field whenever a new survey is submitted, too.
When you say the "field(s) for my expression need to be in the main table," what do you mean? Those fields are in the Survey and as a result in the feature layer. All the data that I'm working with is coming from the Survey123 form. There aren't any related records or tables that I'm working with.
Hello there! I am wondering if you could possibly explain this sentence of yours in more depth: "If you use something like Power Automate or Make, it's possible to use a webhook to update that field whenever a new survey is submitted, too."
I'm a little confused by it; would you care to explain a little more clearly what you mean? I know about Power Automate by Microsoft, which can basically be used for various tasks such as syncing data between locations or sending emails if something occurs somewhere. I'm curious about what you meant and how you suggested using it.
Power Automate and Make can integrate with a Survey123 form and create a webhook. When a new survey is submitted, it can act as a trigger for an external process.
Submit form → power automate / make process → field is updated
You can refer to Esri's own documentation for more information. https://www.esri.com/arcgis-blog/products/arcgis-online/sharing-collaboration/how-to-create-a-hosted...