Select to view content in your preferred language

Prepopulate answers in a repeat with last values

8270
30
08-31-2021 02:40 AM
PaoloBasile_ST
Emerging Contributor

Hello everyone,
I can't seem to create a Survey where the repeat values are prepopulated with the same values as the last record inserted in the repeat (I'm also using the Inbox option).

Let me explain:
I have a form with a geopoint and a repeat that contains two values: date and note

Geopoint
Repeat
-date
-note
end repeat

Image1.JPG

The surveyor has to find the nearest point to him (use Inbox) and has to insert a new repeat record with the date calculated automatically (I know how to do it) and a new note whose value must not be empty but must be prepopulated by the value of the previous note (I don't know how to do it).

I tried using the indexed-repeat () function but I get a cyclic error.

Image2.JPG

Do you have any suggestions?

Thank you in advance for your attention,

 

Paolo

 

0 Kudos
30 Replies
Neal-Kittelson
Regular Contributor

Ok so one more, maybe better option, It works in Connect and from a prelim test, follows to both the field app and the webapp.

Following my example above:

1. Add a calculation to the 'Q1' question and set it to something arbitrary, I set it to ${pos}

2. Save the .xlsx, open the folder location, then exit the form in Connect.

3. From the folder, edit the .xml file and change the calculation for the 'Q1' question

<bind nodeset="/LastFilled/repeatGR/Q1" type="select1" calculate=" /LastFilled/repeatGR/pos "/>  to <bind nodeset="/LastFilled/repeatGR/Q1" type="select1" calculate=" /LastFilled/repeatGR/PQ1 "/>, save and close.

4. Open the form in Connect, and voila, prefilled to the last repeat answered.

However, it will revert once you save the .xlsx again or refresh the form. So it might be the last step before publishing.

@DougBrowning @S_RossWygmans_GISS-T let me know if you test it further past Connect.  I just had a colleague ask if it was possible, so I am not actively working on anything that requires this.