Select to view content in your preferred language

Update Arcade Profiles to include Visualization (symbology) based off related records

1820
4
12-22-2022 09:40 PM
Status: Open
LindsaySpencer
Occasional Contributor

Please allow Arcade visualization profile to incorporate feature set functionality!

I am working with a parcel base. Within that parcel base I have a related table of single check fire services. Some parcels have just 1 related service record, others have upwards of 10. Field staff go into the field using Survey123 to check these services and update the attributes for that related record. This means that with every parcel, there can be updated data AND non-updated data within the related records. I.e. the field crew can go to a parcel, check 2 services one day, but not check the other 3 related records until the next day.

I'd like to symbolize the parcels by the status of "Assessment Complete", "Partially Assessed", and "Not Assessed" from the related records. These values are created using an updated field in the related records table with a simple Arcade expression:

var relate = FeatureSetByRelationshipName($feature, "To_Table", ['Assessed'], false)  //get related records
var cnt = Count(relate)    //count related records
var val = Find("Yes", relate,0)     //find all related records where Assessments have been performed

// if no records have been assessed, return Not Assessed. If all records have been assessed, return Completely Assessed, and if there are some yesses, return Partially Assessed

if (val < 0){
return "Not Assessed"
}
else if (val == cnt){
return "Completely Assessed"
}
else if (val > 0){
return "Partially Assessed"
}

To my extreme surprise, this functionality is not available in AGOL nor enterprise. In AGOL, I get the returned expression accurately tested when run, however I have no way to save and apply the expression, as there is still an error stating that the FeatureSetByRelationshipName is not defined, even though it tested correctly. The "Done" button in the bottom right of the expression window is greyed out.

LindsaySpencer_0-1671773604472.png

In Portal, I simply get the ! that it's not available.

After some digging, I found some interesting information explaining that Arcade's visualization profile does not support feature set functionality. So I am, as my grandmother would say, 'writing a lettahhh' to those who would listen. Please upvote this idea if you can see yourself utilizing this kind of functionality, as this would be fantastic to have!

4 Comments
KristianEkenes

Here's some additional info/context to the rationale for not including feature set functions in visualization and labeling profiles: https://developers.arcgis.com/arcade/function-reference/bundles/#data-access. 

LindsaySpencer

Update: after thinking this through and playing around with my other options, I have created a workaround. Not the most ideal, but it functions. And I used FME, but you could probably accomplish the same with Modelbuilder and/or Python.

As pointed out by the infamous @XanderBakker here (yes Xander, you have a following) the only way to visualize information from a related record in the parent symbology is to write it to a field in the parent layer. So, I created 2 fields in the parent layer with which to hold the values that dictate the symbology.

Using an FME workbench, I brought in the hosted service (with the parent poly and the related table) as the readers, and then transformed the data to assess the updated fields in the related records, calculate the values that would go into the parent fields, and plop them in there. This script runs on an interval on my workstation and only inserts the updates for the 2 fields back into the parent layer, so it takes about 10 seconds to run. Ideally, I'd want this run on a schedule on FME server, but that would take up too many resources for our current setup. So I run it on my machine every 10 min right now. And the symbology gets updated 6x/hour, so that when people are making changes to the related table, they will see that reflected on the map with a refresh shortly after. I know, not ideal. But it works.

But...having the ability to bypass this whole process would still be great 😁 I'm not saying I don't need it anymore. I still need it!! Please allow feature set functionality to be applicable to visualizations!

 

AngelaSchirck

Lindsey,

I too would like to see this functionality.  I have a parcel layer and a related property info table.  The property info table gets updated periodically (when a property sells for example).  I need to symbolize by (e.g. property use or time since last sale) which are not fields in the parcel's schema, but in the related table.  I "worked around" temporarily by creating a view in the database (essentially joining the table values I need to the parcels layer), which is then added to arcpro with a geometry.  I symbolize the view then publish it as a hosted feature layer.  The biggest issue with that is whenever changes are made (typically daily) the hosted feature layer has to be overwritten.  

It would be IDEAL to be able to symbolize the parcels layer by the related table and publish it as referenced registered data so the updates are automatic. 

JacquelineEdwards

I would like to see FeatureSetByRelationship functions implemented for symbology and labels. It is critical for any inspection workflows used offline.