Is there a way to toggle the read only state of a group of fields, that is not tied to a data value/survey question for an existing feature layer?
We have a multi-page survey containing site information that is prepopulated from the feature layer. Biologists will visit the site multiple times throughout the season and thus, edit different elements of survey on subsequent trips. They usually only need a read only view of the site info, as they set out to do their field data collection (eg. fish, inverts surveys). Occasionally, they will want to edit a small section of the site information data (eg, parking details, land access permission status). I don't want to make the entire site information page editable, because I'm nervous about inadvertent updates. To solve this, I added select_one questions at the top of each section, such as "Do you wish to edit land owner information?" Yes, No are the options. The related fields are read only at first, and then become editable if the user clicks 'Yes'. I achieved this by adding expressions like this to the readonly column (regex(${update_landowner_info},'No')
This works great until the user submits the form. At that point, the update toggle fields in the survey site information feature layer become 'Yes' . Then, the next time the user opens the survey, 'Yes' is the default for the "Do you wish to edit.." questions and all of the fields are live for editing.
Given we are working with existing biological monitoring site data, I'm struggling to find a way around this. I tried setting a calculation on the update toggle fields to set the values to 'No' but the user has to click refresh buttons for each of the questions for them to revert back to 'No.'
It seems that my only option is to write a script that resets the "Do you wish to edit..." questions back to 'No' after survey data is submitted. Or, is there an easier way to accomplish my goal? I'd love to have the edit yes/no questions set up so that they do not connect with the feature class at all. Would that be possible?