I'm putting together an arcade expression to populate an ID attribute from a splicecase feature service "downstream" of a fiber tap cable via a Field Map form. For some reason, I can successfully calculate the ID using Arcade Editor in Field Maps Designer, but not in the mobile app. I believe I've narrowed it down to the FeatureSetByPortalItem() function. Using that function throws an error in Field Maps Troubleshooting Log (see subject line). However, when I reconfigure my map to use FeatureSetByName(), it still works in the web version, but I don't get any error in the mobile app (unfortunately, it also still doesn't calculate the ID).
Here is my code:
//TESTING VAULT
//var all_vaults = FeatureSetByName($map, "Auditable Vaults")
//var test_vaults = Filter(all_vaults, 'pathaccessid = 31831')
//var vault = First(test_vaults)
//Console('TEST VAULT: ' + vault)
// Get All Tap features
var const_taps = FeatureSetByName($map, "LOOKUP1",[],true)
//Get Vault Associated with Audit Record
var vaults = FeatureSetByRelationshipName($feature, "crescentlink.sde.sdm_PathAccess")
var vault = First(vaults)
//Get All Taps Intersecting Vault
var intersected_taps = Intersects(const_taps, Geometry(vault))
//Check for No Intersecting Iaps
if(Count(intersected_taps) < 1){
Console("No Intersecting Taps. Returning NULL")
return null
}
//Get Splicecase(s) intersecting Taps
var const_cases = FeatureSetByName($map, "LOOKUP2",['splicepointid'],true)
var intersected_cases = Intersects(const_cases, Geometry(First(intersected_taps)))
//Check for multiple intersected splicecases
if(Count(intersected_cases) > 1){
Console("Multiple Splicecases Selected. Returning NULL")
return null
}
//Get Splicecase VaultID
var sp_vaults = Intersects(FeatureSetByName($map, "Auditable Vaults"),Geometry(First(intersected_cases)))
var sp_vault = First(sp_vaults)
//CONSOLE OUTPUTS
Console('CONST_TAPS: ' + First(const_taps))
Console('INTERSECTED TAPS: ' + First(intersected_taps))
Console('CONST CASES: ' + First(const_cases))
Console('INTERSECTED CASES: ' + First(intersected_cases))
Console('SP VAULT: ' + sp_vault)
return Text(sp_vault.pathaccessid)+'.1'
I believe this issue has been brought up in other places, but there hasn't been any definitive reply from ESRI or the community. See here: https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-works-in-map-viewer-but-not/m-p/1390836#M8050.
Anyone run into similar issues and found a solution? Thanks in advance!