Select to view content in your preferred language

Calculation to copy value from field into field in repeat group - issue in web form

3054
8
Jump to solution
06-10-2021 04:10 PM
JulietK
Frequent Contributor

Hi I have a field inside a repeat which is set to copy the value of a field from outside the repeat, to give a default that the submitter can manually overwrite. 

This works fine in the field app (testing in Survey123 Connect 3.12) - the value of the field 'bagparentq' is shown automatically in the field inside the repeat 'bagrepeatq'. And the fields in any of the repeats can be manually altered, and the manually selected values are retained. 

In the web form though, the field in the repeat correctly shows the selection from 'bagparentq' to begin with. However, once the field is overwritten then the + button is clicked to open repeat #2, the field in repeat #1 changes by itself to the value before it was overwritten. 

Any idea how to ensure the overwrite value is retained when there are further repeats added?

0 Kudos
1 Solution

Accepted Solutions
JulietK
Frequent Contributor

Hi Phil, thank you for your response.

I managed to resolve the issue by using the once() in the calculation. However I have other recurring issues with the repeat (that are occurring when using either web form or field app), so I would be interested in checking out the 3.13 beta. Thank you for the link!

View solution in original post

0 Kudos
8 Replies
by Anonymous User
Not applicable

Hi @JulietK,

Can you please share your XLSForm so we can take a look at how you have configured? Also if there are any files in the media folder etc.

Some features and configurations with repeats are not supported in the web app that are possible in Connect/field app, however in 3.13 we are improving how repeats work in the web app. Have you had a chance to test the Survey123 3.13 beta website available on Early Adopter Community?

Regards,

Phil.

0 Kudos
JulietK
Frequent Contributor

Hi Phil, thank you for your response.

I managed to resolve the issue by using the once() in the calculation. However I have other recurring issues with the repeat (that are occurring when using either web form or field app), so I would be interested in checking out the 3.13 beta. Thank you for the link!

0 Kudos
Ruth_JiatengXu
Esri Contributor

Hi @JulietK 

It is nice to hear that once() solves the issue. If it is possible could you please provide us more information so that we can reproduce and fix the issue? e.g. What is the calculation formula used in the field 'bagparentq'? Does clicking the + button trigger the value change of field 'bagparentq'?

Thanks a lot,

Ruth

0 Kudos
JulietK
Frequent Contributor

Hi Ruth, 

Below is the example that was creating the initial issue. 

 

typenamelabelcalculation
select_one bagbagparentqbagparentq 
begin repeatrepeatgroup</> 
begin groupgroup1group1 
select_one bagbagrepeatqbagrepeatq${bagparentq}
select_one itemitemitem name 
end group   

 

So the field bagrepeatq, in repeat #1 would initially hold the value selected in bagparentq. I manually overwrite the bagrepeatq field by changing the value. 

But once I create repeat #2, the value of bagrepeatq in repeat #1 would revert back to its original value, rather than the overwritten value.

Hope this helps, thank you

0 Kudos
Ruth_JiatengXu
Esri Contributor

Thanks @JulietK ,

I will log the issue in our internal repo, and I will reply to this post once the issue is fixed.

Thanks,

Ruth

AndrewPadilla
Frequent Contributor

Hi @Ruth_JiatengXu was this issue resolved?  Thank you!

0 Kudos
HaroldHerrera1
Frequent Contributor

Hello @Ruth_JiatengXu.

I have a similar question. 

I need to pass a value from one question in the Parent Table (principal survey) to all the related values in the Child Table (repeats). 

  • In the first stage, the user defines the hospital (parent table) and the equipment (child table) as a relation 1-N.
  • In the second stage, another user defines the date (parent table) of the visit to the hospital.

We need to pass the visit date defined in the parent table to all the equipment. This works very well in the app, using the recalculate button, but in the webform the button gets freeze. 

HaroldHerrera1_2-1626988284278.png

 

HaroldHerrera1_1-1626988099244.png

Our workflow is necessary to use Webforms and the App, we designed in Survey123 Connect v. 3.12.232.

 We don't test in Early adopter yet, because this will be in production as soon as possible.

Thank's in advance.

 

 

0 Kudos
JodyZhengLiu
Esri Contributor

Hi @HaroldHerrera1 ,

Thanks a lot for the feedback. There is a known issue for using the recalculate button within repeats(relate table) in the web form. We have it logged on our dev backlog and the target fix date is the end of this year.

Thanks,

Jody Zheng Liu