Hi All
See Acade expression
Var polesLayer = FeatureSetByPortalItem(Portal('myportal'), 'xyz')
var chambers = FeatureSetByPortalItem(Portal(''my portal'), 'xyz')
Var buff = buffer($feature,1,'meters')
Var poles = Intersects(buff,polesLayer)
Var chambers = Intersects(buff,chambers)
var cnt = count(poles)
var cntchambers = count(chambers)
var popupResult = ''
for (var f in poles) {
popupResult += f.barcode + " to pole "
}var ChambResult = ''
for (var f in chambers) {
ChambResult += f.label + " to chamber "
}
var strLenght = count(popupResult)-8
var note = left(popupResult,strLenght)
var strLenght2 = count(ChambResult)-15
var note2 = left(ChambResult,strLenght2)
var popup = IIf(cnt==1, replace(("install subduct " + DomainName($feature,"sub_size")+ " from pole " +text(note)),'to pole',''), ("install subduct " + DomainName($feature,"sub_size")+ " from pole " +text(note)))
var popup2 = IIf(cntchambers==1, replace(("install subduct " + DomainName($feature,"sub_size")+ " from chamber " +text(note2)),'to chamber',''), ("install subduct " + DomainName($feature,"sub_size")+ " from chamber " +text(note2)))
var popup3 = "install subduct " + DomainName($feature,"sub_size")+" from the chamber "+ChambResult+" to the pole "+popupResult
var popup3 = replace(popup3,' to pole ',"")
var popup3 = replace(popup3,' to chamber ',"")
var finalresult = when(cnt <= 2 && cntchambers==0,popup,cnt == 0 && cntchambers==2, popup2,cnt == 1 && cntchambers==1, popup3,'n/a')
return finalresult<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN> i am using this expression to check if a line is intersecting two point feature layers and return an expression to run a specific type of subduct between each feature. the expression works as expected in the pop up but when i try to run it in the field calculator it fails with the expression
"Cannot read property 'length' of undefined error"