Cannot pass value to popup through Arcade

557
1
07-08-2020 09:23 AM
AdamAbeles
New Contributor

Hey everyone,

I am trying to create an attribute expression to auto-populate a field in collector based on another features location to the point placed. I have a dataset of OH Electric Circuits and a feature called exceptions which will be placed by a field user. I want the circuit data to populate the newly created exception form in collector based on a buffer of 75 feet. I believe this is achievable through an Arcade expression in AGOL on the web map side. Below is what I have so far.

var circuits = FeatureSetByName($map,"Primary OH Conductor", ['BASE_CIRCUITID'])
var buff = Intersects(circuits, Buffer($feature, 75, 'feet'))
var baseCircuit = "BASE_CIRCUIT = '" + circuits + "'"
console(baseCircuit)
if(buff != null){
return Filter(buff, baseCircuit);
}

With this I get a featureSet returned but with nothing in it. Before I placed the filter function on 'buff' I could see the feature set returned had the values I was expecting. However, whenever I configured my custom popup to show those values, no data would show in the popup. Not even other values based on fields in the feature layer. Any help would be appreciated, this may not even be the route to go for the solution I need so if you have any ideas on populating collector forms with existing data I'm all ears.

0 Kudos
1 Reply
XanderBakker
Esri Esteemed Contributor

Hi Adam Abeles ,

I am not sure if this will work the way you want it to work, but I can give you some pointers on what is going wrong with the expression you have at this moment. In your third line you concatenate a text with a featureset (remember the variable "circuits" represents featureset with 0 or more features). In case you are trying to get the predominant BASE_CIRCUITID from the primary overhead conductors, you could use the GroupBy function or a loop to get that result.

If you have your data residing in an Enterprise geodatabase, you could also implement an attribute rule.

0 Kudos