Hi,
My system configuration:
Arcgis Enterprise: 10.8.1
Arcgis Pro: 2.9.2
I'm getting an "Error on line 6. Unexpected null" when I try to validate the code shown below in the Pop-up profile of Pro. The code tries to get a record from a related table of a feature and show one field of the related record in the Pop-up. I'm using FeatureSetByRelationshipName and Filter functions to get the records from the related table.
I tried with different field names or the 2 syntax (feature.fieldname or feature['fieldname'], and I always get this "Unexpected null" error when trying to query a field. I know that everything is working until line 6 because I used the Count function and it returns the expected number of record count; also, I used the TypeOf function to check the type of the variable "t" and it returned "Feature".
var results_FS = FeatureSetByRelationshipName($feature, 'R0L100Electric_DeviceL1508Device_Unit', ['*'], false)
var transf_FS = Filter(results_FS, "assettype = 785")
var t = First(transf_FS)
if(IsEmpty(t.assetid)){
return domainName($feature, 'assettype') + ': ' + $feature.assetid
} else {
var s = t.assetid
domainName($feature, 'assettype') + ': ' + $feature.assetid + ': ' + s