Attribute Rule Error on Published Feature Service

2427
10
01-19-2021 09:35 AM
JoshHellman1
New Contributor

Hello,

I am applying the following Attribute Rule Arcade expression to a FC with a related table:

var table = FeatureSetByName($datastore,"Arrowhead_Ph2_Relocation_Table")

var total = 0

for (var t in table)

if (t.BLK_PRCL_NUM == $feature.BLK_PRCL_NUM) {

total = total + t.TOT_RELO_AMNT_OFRD

}

return total

I publish the FC and related table as a service, however, when I try to edit I get the error message below.  If I look at the attribute rules of the published service FC, I notice it changes my Arcade expression from the related table name above to an ID number.

When I test the attribute rule directly from the GDB it works perfect.

Here is the portion of the expression in the attribute rule it changes once it's published as a feature service:

var table = FeatureSetByName($datastore,"{A2D0EBF1-2A6C-4EC2-BAE3-852F03E47EBB}")

JoshHellman1_0-1611077223917.png

Why does it change my arcade expression from the Table Name I input in the expression, to the ID number? When it does this it's making the expression not find the table name in the GDB and generates this error.

Thanks!

 

10 Replies
JoeBorgione
MVP Emeritus

Where is this published: to your portal or AGOL?

Is the ID number that it changes it to the correct table? Can you edit the rule once it's published? (I don't think you can....)

That should just about do it....
0 Kudos
JoshHellman1
New Contributor

It's published to our Enterprise server.

I'm not sure where that number it assigns comes from?  Or what is causing it to convert once it's a published service.

I have been editing the expression after it's published. First I stop the service from running, then I edit the expression, save the attribute rule, and publish to overwrite the service.

The attribute rule is using a field in the origin table, and when records in the related table are inserted or updated, I want to sum those totals for all matching parcels and write that total value back in the origin table.

Thanks!

0 Kudos
NJJLuus
New Contributor

Hi @JoshHellman1, have you been able to establish the source of this issue and a way to fix it?

Did you perhaps import the rules to this Feature Class oor dit you create it from scratch? I suspected that it had something to do with the fact that you copy over the whole Arcade Expression and somehow the reference to the old table (from where the code originated).

 

0 Kudos
JessicaJThompson
Occasional Contributor II

Have you been able to remedy this? I am working on publishing a feature service in portal and would like to use attribute rules. I know that this doesn't work in AGOL. Does it work with portal? 

 

Thank you,

Jessica

0 Kudos
NJJLuus
New Contributor

Hi again thread-members.
@JessicaJThompson, It should work fine with an Enterprise (portal) deployment. I have been using it successfully with the issue/(bug?) that pops up every now and then. I have still not got a definitive answer to my issue but the bug seemed to be less likely to appear when I published the feature with the setting to "Allow assignment of unique numeric IDs for sharing web layers" left unchecked.

NJJLuus_0-1641540083472.png

 

Hope this helps.

Nico

 

0 Kudos
Bio_InfoAdmin
New Contributor II

Hi there, i am having the same issue, but the feature service i am referencing to updates overnight, and it leaves me with a random ID (so Conservation.Cons.ParkExtent, changes to a random ID) This is the code i am using at the moment. Is there anyway to solve this?

//search ParkExtent reference table
var zones = FeatureSetbyName($datastore, "CONSERVATION.CONS.ParkExtent",["SiteName"],true);

//Get a feature set of zones that intersect the address
var intersectingZones = Intersects(zones, Geometry($feature))

// Select the first record in the feature set
var matchedZone = First(intersectingZones)

// Return the SiteName value of the selected zone
return IIf(IsEmpty(matchedZone), null, matchedZone.SiteName);

0 Kudos
AnneSantaMaria
New Contributor III

Has anyone heard anything additional about this bug/error? We are experiencing the same issue. Just curious if there have been any updates.

0 Kudos
JordanM_Support
Esri Contributor

Hi @AnneSantaMaria and others, please try following the steps in this technical article,  which addresses this particular error message. From the article: "The error message is returned when an attribute rule is added to a feature layer and the 'Exclude from application evaluation' option is not enabled. This option allows edits to be evaluated at the database level, rather than by ArcGIS Pro, before the edits are sent to the source database."

 

Thanks,

Jordan

0 Kudos
JBeasley
New Contributor III

Hi Josh, 

Did you ever find the cause for this? Or a permanent fix?

We are experiencing the same thing. The table name we reference in an expression is being changed to a global ID looking string. The change is seemingly random. We have services published from this data source- some to Enterprise, some to AGOL. AGOL services are only used for viewing, no editing. We built the rules from scratch and can "repair" them by changing the name back to the actual table name then overwriting the services, but every few months it seems to revert to a global ID string. 

Thanks!

0 Kudos