I would like to extract attribute from a table to update attributes of a point feature class
Ah. Well, that is not what your original attribute rule does (and so it's also not what my rule does). These rules will do it the other way around: They will update/add a row in the table when you update/add a point in the feature class.
No worries, what you want is actually easier:
// Calculation Attribute Rule on asset_july_2023
// trigers: Insert, Update
// field: empty
// get the first related row from tbl_asset_info
var key = $feature.Asset_NAME
var asset_infos = FeatureSetByName($datastore, "tbl_asset_info", ["*"], false)
var asset_info = First(Filter(asset_infos, "Asset_NAME = @Key"))
// abort if no related row was found
if(asset_info == null) { return }
// return the related row's attributes
return {
result: {
attributes: {
ASSET_ID: asset_info.ASSET_ID,
TYPE: asset_info.TYPE,
VALUE: asset_info.VALUE,
}
}
}
The null check in line 11 will solve your error message.
Have a great day!
Johannes