Hi all,
as described in this blog, we can use the FeatureSetByAssociation function, for example, to get all the containments of the station boundary. However, there is a message that the syntax is invalid if there is a variable as input (not $feature). Does anyone has an idea how to fix it?
Thank you.
var boundaries = FeatureSetByName($datastore, 'StructureBoundary', ['globalid'], true) //get all structure boundaries with geometry
var intersect = Intersects(boundaries, $feature) //get all boundaries that intersect with created feature
var stationBoundary = First(intersect) //select first station boundary (the only one) in order to convert from featureSet to feature
var content = FeatureSetByAssociation(stationBoundary, 'content') //get all containments of stationBoundary -> ERROR Invalid expression. Feature expected.
var assembly = Filter(content, "className = 'ElectricAssembly'") //filter containments for electricAssemblies
return{ //returns nothing - edits to containment of class "ElectricAssembly" with globalid of assembly
"edit":[{
"className": "^UN_Association",
"adds": [{
"fromClass": "ElectricAssembly",
"fromGlobalId": "assembly.globalid",
"toClass": "ElectricJunction",
"toGlobalId": "$feature.globalId",
"associationType": "container"
}]
}]
}