Select to view content in your preferred language

Attribute Rules Preventing Layer from Loading in Field Maps

162
2
Jump to solution
3 weeks ago
DarrylAlbert
Regular Contributor

I have attribute rules setup in my enterprise geodatabase on a point feature class.  It's a fairly simple arcade expression that pulls the most recent inspection date from a related table. 

var inspTable = OrderBy(FeatureSetByRelationshipClass($feature, 'DBO.Outfall_to_IDEPScreening'), 'ObsDateTime DESC');
var mostRecent = First(inspTable);

If(!IsEmpty(mostRecent))
Return mostRecent.ObsDateTime;
Else
Return null;

The rule works great in ArcGIS Pro.  When I republish the service, the layer will not load in Field Maps.  However, it will load in the ArcGIS Online map viewer without issue.  After much searching, ChatGPT tells me that attribute rules are not fully supported in Field Maps.

Anyone have any insight on this issue?  I think my workaround will be to implement the arcade on the fields in the web map.  This creates the problem where the data is only updated in the web map, I would like it to be updated regardless of where/when an edit occurs. 

 

Thanks!


Darryl Albert

0 Kudos
1 Solution

Accepted Solutions
DavidSolari
MVP Regular Contributor

As per tradition, ChatGPT is subtly incorrect: you can't author attribute rules in the Field Maps designer, but if you're using a registered feature service with attribute rules those can work just fine. A couple of things to check:

  1. Did you check off "Exclude from application evaluation" for your rule? If you don't enable this option, Field Maps will try to evaluate the rule before submitting any data, which is impossible without the related table on hand. In general, if your attribute rule refers to any data outside the current $feature you must check this box to prevent errors.
  2. Another possible issue: FeatureSetByRelationshipClass is a fairly new function and your Enterprise might not fully support it. You may need to use the more available FeatureSetByRelationshipName function to grab your related data.

View solution in original post

2 Replies
DavidSolari
MVP Regular Contributor

As per tradition, ChatGPT is subtly incorrect: you can't author attribute rules in the Field Maps designer, but if you're using a registered feature service with attribute rules those can work just fine. A couple of things to check:

  1. Did you check off "Exclude from application evaluation" for your rule? If you don't enable this option, Field Maps will try to evaluate the rule before submitting any data, which is impossible without the related table on hand. In general, if your attribute rule refers to any data outside the current $feature you must check this box to prevent errors.
  2. Another possible issue: FeatureSetByRelationshipClass is a fairly new function and your Enterprise might not fully support it. You may need to use the more available FeatureSetByRelationshipName function to grab your related data.
DarrylAlbert
Regular Contributor

Thanks David, that solved my problem.  I appreciate your response, I spent way to much time trying to figure that out.  It was the FeatureSetByRelationshipName that solved it. 

I was getting an error in the Field Maps app saying I needed a newer version of runtime, so that explains it. 


Thanks!

Darryl