Select to view content in your preferred language

How to attribute rules use features from feature class not in edit service

567
3
Jump to solution
04-05-2022 01:30 AM
Zoggo
by
New Contributor III

I'm using attribute rules to calculate the name of a community when editing a new polygon.  All our datasets are hold in a enterprise geodatabase. We do editing with branch versioning and services. Basically the arcade script is working when I put the community feature class in the same edit service as the editing polygon feature class. Is there a way to access the community feature class without add it to the service? Both FC are in the same enterprise geodatabase.

This is my arcade code for the calculation:

var fsGemeinden = FeatureSetByName($datastore, "AGIS_409_Dev.U_ALG_APP.va_gemeinde_sv", ["GEMEINDE"], true)
var fsGemeindenIntersect = Intersects(fsGemeinden, Geometry($feature))
if (Count(fsGemeindenIntersect) >0){
 var maxGemeinde
 var maxArea = 0
 for (var gemeinde in fsGemeindenIntersect){
  var areaGemeinde = Area(Intersection(gemeinde,$feature))
  //console(areaGemeinde)
  if (maxArea < areaGemeinde){
   maxGemeinde = gemeinde
   maxArea = areaGemeinde
  }
 }
 console (maxGemeinde.GEMEINDE)
 return maxGemeinde.GEMEINDE
}

 

0 Kudos
1 Solution

Accepted Solutions
Jake_S
by Esri Contributor
Esri Contributor

Zoggo,

Yes. Your code looks fine, the issue may be that the attribute rule is not configured in a way to allow it. Do you have the Exclude from Application Evaluation parameter checked?

JS_Esri_0-1649233592144.png

This allows the application to see tables not present in the service. This is outlined here

~ Jake

View solution in original post

3 Replies
Jake_S
by Esri Contributor
Esri Contributor

Zoggo,

Yes. Your code looks fine, the issue may be that the attribute rule is not configured in a way to allow it. Do you have the Exclude from Application Evaluation parameter checked?

JS_Esri_0-1649233592144.png

This allows the application to see tables not present in the service. This is outlined here

~ Jake

Zoggo
by
New Contributor III

That works for me. Thanks a lot!

0 Kudos
Jake_S
by Esri Contributor
Esri Contributor

No problem. Can you check and post if were able to do so?

0 Kudos