Calculated field value getting reset when switching between repeat records

672
5
02-22-2018 08:38 PM
SudhirPonnappan1
New Contributor III

I have a survey that collects Landowner Address information and if the remittance address is different, the Remittance Address is recorded as well. There is a field (RemittedPayment) which if answered 'Yes' the option to enter remittance address is given. I would like the Remittance Address to be the same as Landowner Address provided the RemittedPayment='No', else record the value that is entered in the Remittance Address field.

I am not sure if this is the right formula for the calculation field which is set as:

if(${RemittedPayment}='No', ${Address}, '')

On the survey form, the remittance address entered is cleared out when switching between the repeat records. It appears that the calculation is triggered every time back and next buttons are clicked.

Any help would be greatly appreciated.

0 Kudos
5 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Sudhir,

To confirm, you are using the latest version of Survey123 (2.6)?  I'm not able to reproduce the behavior you are describing.

0 Kudos
SudhirPonnappan1
New Contributor III

Hi James,

Thank you for the response.

Yes, I am using the latest release of survey123.

Say, if you add the first landowner record with a remittance address. Now add a second landowner record (repeat) and if for any reason hit the back button to go to the previous landowner records, the Remittance address is cleared out.

As shown in the graphic below the remittance address is cleared out when I click the back arrow (1 of 2)

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Sudhir,

I see the issue- yes, in your design you would have this issue; my attempt at reproduction had the yes/no question in the repeat.  I would suggest the 'Another Address' should be within the repeat, as you are saying that both yes and no can exist for the address state and this varies per repeat.

0 Kudos
SudhirPonnappan1
New Contributor III

Hi James,

The Remittance Address is indeed within the repeat. It is placed in a group, which is nested within the repeat. 

I am attaching a copy of the XLSX spreadsheet used to generate the survey.

I would like to have the same mailing address to be populated in remittance address group if the condition (Remit Payment = 'Yes'), else capture whatever is input by the user.

Does the calculation get applied everytime you navigate to a repeat record?

Thanks,

Sudhir

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Sudhir,

If the yes/no question is outside the repeat, I would expect the calculation to be refreshed when moving between repeats.  As I mentioned above, the yes/no question should be within the repeat.

0 Kudos