Hidden Fields in Repeats being reset when new repeat record added

345
6
Jump to solution
05-05-2022 08:20 AM
KevinPiraino2
New Contributor III

I am having an issue where hidden fields in a repeat are reset/recalculated when a new repeat record is added. The workflow I have consists of an end user submitting an initial record and then using a dashboard with an embedded survey to submit subsequent repeat records. The embedded survey is the same survey as the initial submission survey. The issue I am running into is that when an end user needs to add additional repeat records using the dashboard, the previously submitted repeat records values get overwritten with the "Calculate" field expression output. This issue does not occur though when the field type is set to "Integer" instead of "Hidden". When the field type is set to "Integer", the form respects the previously submitted repeat values and retains them when new repeat records are added. This issue also persists when the field type is set to "Calculate".

The issue I believe stems from needing to use the "coalesce" function to force a repeat record to calculate a "0" value instead of a blank string so as to properly sum all the repeat fields in the main record. 

 

Attached you will find the XLSX spreadsheet containing my working survey. 

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Honored Contributor

Not an answer but a workaround.  You can set it to integer then use the hidden appearance or use the body::esri:visible column.

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-hidden-relevant-an... 

Hope that helps

View solution in original post

6 Replies
DougBrowning
MVP Honored Contributor

Not an answer but a workaround.  You can set it to integer then use the hidden appearance or use the body::esri:visible column.

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-hidden-relevant-an... 

Hope that helps

KevinPiraino2
New Contributor III

Doug,

Thank you for your assistance with this issue, it seems that the "body::esri:visible"  column workaround works, but the appearance "hidden" workaround did not. The appearance "hidden" workaround functioned no differently than the field type "hidden" solution.

DougBrowning
MVP Honored Contributor

Interesting.  My only other idea is set the bind::type column to int.  This binds inside the form vs bind::esri:fieldType is for submission.  It could be 123 web is flipping it to string then back again quick.

0 Kudos
KevinPiraino2
New Contributor III

I tried this as well in my futile attempt to resolve the issue. Thankfully it seems that your workaround regarding the "body::esri:visible" column worked. As for the 123 web doing something funky, that was my first assumption since it seems that "editing" or adding additional repeats to an existing record is really only mentioned/suggested in the mobile app and not the desktop app.

0 Kudos
KevinPiraino2
New Contributor III

Since I believe my original issue stems from needing to use the coalesce function to force a zero value instead of an empty string. Is there a way to force this same procedure without using the coalesce function? To use the coalesce function I am having to use additional field to store the initial numeric value to compare against in the coalesce function or can I use the coalesce function in the calculate field of the the same question? (see attached spreadsheet for more clarity of the survey set-up/workflow).

0 Kudos
DougBrowning
MVP Honored Contributor

No coalesce would not do much.  I would try bind type all to int on both the if 0,1 and the .  Other than that I don't use the web form so not sure.

Oh well it could maybe be the way you have relevant.  Or it is loading relevant in the wrong order so that it is changing it to '' on you. 

But Relevant should be a calc to true not to yes. 

Change

if(selected(${Component},'CNT'),'yes','')

to just

selected(${Component},'CNT')

0 Kudos