Attribute Rule from Attachment Table to Standalone Table

327
1
10-17-2022 08:45 AM
brimcel
New Contributor II

We are trying to use an attribute rule that creates a record in a standalone table when an attachment is added to a point feature. The rule is assigned to the attachment table. We are having issues populating a variable for the GlobalID of the point feature. We have been able to get this action to work on a branch versioned, registered feature service in ArcGIS Pro (version 3.0.2) but have not been able to get it to work in Portal (Enterprise 11.0).

When adding an attachment via Portal, both of these lines return a blank GUID ({00000000-0000-0000-0000-000000000000}):

//Attempt 1
var assetGUID = $feature.REL_GLOBALID;
//Attempt 2
var assetGUID = $feature["REL_GLOBALID"];

 And a workaround attempt like this returns null:

//Attempt 3
var relatedAssetFS = FeatureSetByRelationshipName($feature, 'RelationshipClassName',['*'],false);
var assetGUID;
if (Count(relatedAssetFS) == 0) {
    assetGUID = null;
} else {
    var relatedFeat = First(relatedAssetFS);
    assetGUID = relatedFeat.GLOBALID;
}

All three of these attempts are successful when adding the attachment via Pro. It's almost as if Portal populates the REL_GLOBALID and creates the relationship after running the attribute rule, while Pro does the opposite. Do Pro and Portal handle this process differently? Is there another way to write this expression? Thank you!

 

@XanderBakker 

@HusseinNasser2 

0 Kudos
1 Reply
MikeMillerGIS
Esri Frequent Contributor

If you use Fiddler, can you compare the apply edits payload?  Maybe they are going down different paths.

0 Kudos