ArcGIS Online- Map Viewer Forms- Logic Issue

262
5
2 weeks ago
Amanda__Huber
MVP Regular Contributor

Hello ArcGIS Online Team, 

We recently stumbled into an issue where 'Calculated Expressions' and 'Editability' cannot exist together. This causes a fairly large issue for those who would like to auto calculate fields but still allow users to update/edit that field. 

Our specific use case is that some conditions allow for this field to be editable, and other conditions will create the auto calculate. Since this functionality does not work we are unable to go live with this portion of the workflow in the application.  

 

Amanda__Huber_0-1714593625832.png

Please advise. 

Thank you, 
Amanda Huber

5 Replies
RhettZufelt
MVP Frequent Contributor

Have you seen this post How to override values for fields with calculated expressions?

Shows a way to toggle the ability to manually edit a calculated field.  Might be able to tie it to you existing data rather than a toggle, but figure it might help you get started.

R_

bbollin
Esri Contributor

Hi @Amanda__Huber, you are correct that calculated and editable expressions are unable to coexist on the same field. This is something we are aware of and always glad to hear more use cases for supporting it. The blog that @RhettZufelt linked it a good workaround for this work flow however

Amanda__Huber
MVP Regular Contributor

@bbollin IThanks for your response, finally getting time to circle back around on this.

Unfortunately the workaround doesn't quite work with our workflow, there's no use case for a toggle override.

Our workflow- We have three types of observations. These observations are typically sequential in order based on the bird's nesting time-frame and all fields are editable
-but- 
Sometimes volunteers don't get to a nest until observation 2 or 3 in which we need the prior observations's fields to to be calculated to our default (use the calculated expression). 

Amanda__Huber_0-1715714172769.png

I don't see a good way to fit a toggle into this scenario with our workflow. Please let me know if you have any ideas. 

 

That being said, I think there are many use cases for this to be an enhancement that Esri implements as it's quite silly that calculations and editability can't both be in a form

 

Thanks, 

Amanda Huber

AlixVezina
Esri Regular Contributor

Hi @Amanda__Huber , I am not sure I fully understand all the details of your implementation described above, but I'll give it a try.

The toggle itself is not necessary. The bigger idea is that a field can become editable based on a condition expression.

For example, you could have calculated expressions set for all the fields above the Observation Period field. These could be calculated automatically at all time.

Then, you could also add an Editable condition to these fields as well, so that they will become editable if the Observation period value selected is Observation 1.

This means if the Observation period selected is 2 or 3, the fields remain calculated and uneditable, but if the user chose Observation 1, then they become editable.

I hope that makes sense.

RhettZufelt
MVP Frequent Contributor

Not exactly sure what you are trying to accomplish, especially the prior observation field, etc.

However, in case it might help, I have tested this arcade with the editable logic:

 

var arr = ["Observation 1", "Observation 2"]  //  List to compare to

if (Includes(arr,$feature.ObsvPeriod)){
  return true
}else{
  return false
}

 

If I have a field that is calculated (and thus not editable) the calculation will fire as normal.  However, if I attach the above code to the Editable logic expression for that field, then, if the values of "ObsvPeriod" are equal to "Observation 1" or "Observation 2", then the field will become editable.  If it is any other value, the field will be populated by the calculated expression attached to it.

In case this helps somehow,

R_

 

edit:  I see @AlixVezina beat me to it....