Hi there AGOLers,
I'm sure others must have asked this before, but wasn't able to find the solutions in my web searches.
I have set up an arcade expression to pass attributes from the parent polygon to the related table.
This is great for the field team. It's cutting out a lot of repetitive filling in.
Sometimes however the data that is being passed through is incorrect or needs to be modified or overwritten.
Is there a way to do this? In Map Viewer's Form> Logic if I have a Calculated expression applied (to auto-populate the answer) I have to turn Logic's Editable off.
Are there any work arounds for this? Or is there a road map to allow for editing the output of Calculated expressions?
I have considered setting up a default template, but that only works for static answers right?
The reason why I am asking this question is I have a bunch of Experience Builders set up that currently pass attributes from a layer in the map into new related records in ExB's Survey123 widget. It would save me a lot of set up time if I just used the calculated expression in Map Viewer forms now that related records can be viewed, editted and added in Map Viewer.
Solved! Go to Solution.
Hi @elpinguino, it is not currently possible to have an editable calculated expression but it is on our road map! We appreciate the feedback, feel free to give this idea a bump as well https://community.esri.com/t5/arcgis-field-maps-ideas/allow-editing-on-fields-with-arcade-calculated...
Hi @elpinguino, it is not currently possible to have an editable calculated expression but it is on our road map! We appreciate the feedback, feel free to give this idea a bump as well https://community.esri.com/t5/arcgis-field-maps-ideas/allow-editing-on-fields-with-arcade-calculated...
@elpinguinothere are some workarounds you could try to make this work in the meantime:
Hi @bbollin .Thank you for your reply and providing workarounds. I tried editing the web map's JSON in ArcGIS Assistant, but couldn't get the auto-populate to work in conjunction with the editable setting.
This is what I tried. In the CommsRecord layer, tested on Contact_First_Name field. In Map Viewer applied this arcade expression to pass the attributes. I didn't name the relationship at the time of publishing, so that's why it is ''.
// load all related features
var related_features = FeatureSetByRelationshipName($feature, '', ['PrimaryOccupierContactFirstName'], true)
// select one of those features, here we just grab the first one
var related_feature = First(related_features)
// if there are no related features, related_feature will be null and we will
// get an error down the line, so we need to check that and return early
if (!IsEmpty(related_feature)) {
return related_feature['PrimaryOccupierContactFirstName']
} else {
return null
}
Turned off editable in Map Viewer Form. Saved Form. Saved Map.
Went into ArcGIS Assistant > Map Viewer item > JSON. Changed "editable" for only this field from false to true.
This is the output if I have the Map Viewer form formatted with editable turned off.
This is the output if I have the Map Viewer form formatted with editable turned on.