Attribute Rules and ArcGIS Collector

1231
6
06-17-2020 01:21 PM
FraserHand
Occasional Contributor II

Hi there,

We have done some extensive testing with Collector and it looks like attribute rules are not support for client side evaluation especially during offline workflows @10.8. Can someone confirm this is the case and if so, what is the time frame for this support?

Thanks

Fraser

Jeff Shaner

0 Kudos
6 Replies
DallasCrow
New Contributor III

It is possible to use Attribute Rules with Collector, even offline. I recently released an offline workflow to our field crew that leverages immediate calculation rules and the 'add' dictionary keyword to write new inspections to a related table. The rules are evaluated as soon as the offline area is sync'd back to the database. When online, the rules evaluate immediately. 

There is an execution setting, "Exclude from application evaluation" which is required when an attribute rule includes dictionary keywords. I initially assumed this meant they were not supported in Collector, but our rules still perform as intended with this option enabled.

ESRI covers the use of Attribute Rules with offline data here: 

Feature layers you publish from ArcGIS Pro that reference your registered data can include attribute rules. When you edit the feature layer, ArcGIS applies the attribute calculation and constraint rules you defined in the geodatabase. Any time an edit violates one of these rules, the editor receives an error. However, if you edit the data while offline, the attribute rule information is not included in the offline data. When you synchronize the data with the feature layer, the rules are applied at that time. How the violations are treated depends on how the data is registered.

  • If you use data that is registered as versioned, attribute rule violations prevent the synchronization process from taking place. Synchronization returns an error when an edit violates an attribute rule. You must correct the violation in the offline version of the data and try to synchronize again.
  • If you use archive-enabled, nonversioned data, synchronization completes but edits that violate attribute rules are not applied. Information is written to the ArcGIS Server log for the edits that did not synchronize. If you use nonversioned data and attribute rules, you should always check the ArcGIS Server log after synchronizing to see which (if any) edits were not synchronized. Correct the violation in the offline version of the data and synchronize again.
0 Kudos
FraserHand
Occasional Contributor II

Hi Dallas,

Thanks for the reply. I had a simple rule which returned a guid(); for both the feature class and related table. I tried with the exclude option on and off and when offline the rule wouldn't calculate. We tried with Android and iOS. Can you share an example of one of your rules? Would be good to see what I'm missing.

Thanks

Fraser

0 Kudos
FraserHand
Occasional Contributor II

Taking a look at the link:

However, if you edit the data while offline, the attribute rule information is not included in the offline data. When you synchronize the data with the feature layer, the rules are applied at that time.

I'm using a rule to generate an Id with is used as the PK and FK for a relationship. Since this isn't evaluated offline it doesn't look like this workflow will work for me. We had tested online and it was ok.

Thanks

0 Kudos
FraserHand
Occasional Contributor II

Sorry - one more - I'm assuming you do something like this right:

return { 'result': noAddress + ' addresses found in the district.', 'edit': [{ 'className': 'Address_pnts', 'updates': AddList }] }

As in for your inspection you are adding predefined values for the fields - the user in offline mode cannot edit the related table record unless its using objectid or globalid as the PK / FK

Thanks!

0 Kudos
DallasCrow
New Contributor III

Yes, I'm using something like that. I pass our primary key (globalid) to the foreign key (guid) in the attributes list. I went through a few versions of the rules (we have about 20) and sometimes did have a problem where edits wouldn't update the other class when made offline.

Can you share more about how you're generating your primary key? 

0 Kudos
FraserHand
Occasional Contributor II

Hi Dallas,

We aren't using objectid or globalid for PK / FK due to some other limitations we have - so the attribute rule just uses the Arcade function Guid() to generate a new guid for the key.

Thanks

0 Kudos