Form - After passing attributes from parent to related table - Possible to edit?

398
3
Jump to solution
01-25-2024 12:05 AM
elpinguino
Occasional Contributor III

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.

elpinguino_0-1706169668543.png

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.

1 Solution

Accepted Solutions
bbollin
Esri Contributor

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...

View solution in original post

3 Replies
bbollin
Esri Contributor

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...

bbollin
Esri Contributor

@elpinguinothere are some workarounds you could try to make this work in the meantime:

  • Edit the web map item's JSON to make the field editable.
  • Current workaround:
    Create an extra field that determines if the field with a calculated expression is editable or not, given a condition. If the condition is fulfilled and the field can be edited, then the calculated expression is not applicable.
    Drawback: need to add extra fields to your schema just to handle this.

    Example: street name calculated based on intersecting features
    • bbollin_4-1706201052617.pngbbollin_5-1706201063708.png

       

elpinguino
Occasional Contributor III

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.

elpinguino_0-1706490944088.png

This is the output if I have the Map Viewer form formatted with editable turned off.

elpinguino_2-1706491069278.png

 

This is the output if I have the Map Viewer form formatted with editable turned on.

elpinguino_1-1706491054290.png

 

0 Kudos