Are you tired of seeing the records' GUID value and want to see the actual record' name?
This video shows different methods of displaying the Records' name instead.
And here is the Arcade expression used. Just make sure to replace 'RecordHasTax' relationship class name with your relationship class name. If you are using enterprise geodatabase (AKA 'SDE') make sure to use the fully qualified name (as @GordonSumerling rightfully points down below):
// Arcade expression to return the associated record name
var RecordName = First(FeatureSetByRelationshipName($feature, 'RecordHasTax', ['Name'], false));
if (!IsEmpty(RecordName)){return RecordName.name;}
return "Missing a record";
@AmirBar-Maor this is a great tip. Couple of comments:
cheers
Gordon
Not sure I follow. I am just moving this rule over to a branched service environment as setup by my Enterprise Admin Folks (11.X/3.11. The relationship classes are not visible in the portal but they are working because I can select all features associated with a record and it works. Are you saying that the relationship classes must be explicitly published (so I can see them in portal)?
var records_features = FeatureSetByName($datastore,
"<insert records feature class here>",
["Name", "GlobalID"], false);
var ret_guid = $feature.RetiredByRecord
var match = Filter(records_features, "GlobalID = @ret_guid");
var matchfeature = first(match);
if (matchfeature != null){
return matchfeature.Name
}
return null
Here is an attempt at making an Arcade Expression for the looking up the Retired By GUID and pushing the Retired By name into an additional field. It might be a little more generic and more easily adapted to other ParcelTypes.
Thanks @SamMontoia1
I've also added 2 text fields on the parcels and lines to store the record names of the records that created and retired the feature.
It turns out that SQL Server requires the special "@" added. Since parcel lines don't have a relationship class a SQL Filter is used.
For the 'CreatedBy' field on the Lines table:
var RecordFS = FeatureSetByName($datastore, 'GIS.PF_Records',["GlobalID", "Name"], false);
var guid = $feature.CreatedByRecord;
var sql = "Globalid = @guid"
var Record = First(Filter(RecordFS, sql));
If (IsEmpty(Record)) {
return "---";
}
return Record.Name;
For the 'RetiredBy' field on the Lines table:
var RecordFS = FeatureSetByName($datastore, 'GIS.PF_Records',["GlobalID", "Name"], false);
var guid = $feature.RetiredByRecord;
var sql = "Globalid = @guid"
var Record = First(Filter(RecordFS, sql));
If (IsEmpty(Record)) {
return "---";
}
return Record.Name;
In my case I wanted to see the record names in a label, and since labels do not support feature sets in Arcade, I had no choice but to add the fields and use attribute rules to populate them.
In my expressions, 3 dashes '---' are returned if no record name is found (e.g it's NULL).