Select to view content in your preferred language

Grab end value from repeat to use as beginning value in new record when using Survey123 in a web browser

532
4
Jump to solution
06-09-2026 10:04 AM
Bec
by
Frequent Contributor

Hi!

I am currently using Survey123 Connect version 3.25.  I have a repeat section that has a starting footage value and an ending footage value.  I would like to take the value from the ending footage and use that as the starting footage value for the next record in the repeat.  For example if the user enters 0 for the starting footage and 25 for the ending footage, then the next record they add will automatically have a starting footage of 25.  I can get this working in Survey123 Connect Preview with a JavaScript or by using the max function as referenced by this post:  https://community.esri.com/t5/arcgis-survey123-questions/populate-a-field-within-a-repeat-from-a-pre...   However, neither of these options seem to want to work when accessing the survey via a web browser which is where the survey will mainly be used.  Is there a way to possibly get this to work?  If not, it's not a deal breaker for my survey, it is just a nice to have, as the user doesn't have to enter that value when they move on to the next record in the repeat.  See below images for expected behavior as it appears in Survey123 Connect preview.

Begin and End Footage.png

 

Summary.png

 

I'm also attaching a copy of my survey excel sheet along with the JavaScript files so you can create a copy of this same survey yourself to test.  Any help is greatly appreciated!

 

Bec

 

0 Kudos
2 Solutions

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

When I had this come up I kinda cheated and just used max(${StartingField}).

I think you could possibly also use indexed-repeat(question, repeat, index number) now but it seems not as reliable.

Be aware no matter what you do if they go back a few repeats and edit values it all falls apart on you.  Not much you can do about that.  

View solution in original post

Neal_t_k
MVP Regular Contributor

This calc for begin_ft appears to work in the web:

indexed-repeat(${end_ft}, ${parking_do}, position(..)-1)  

View solution in original post

4 Replies
DougBrowning
MVP Esteemed Contributor

When I had this come up I kinda cheated and just used max(${StartingField}).

I think you could possibly also use indexed-repeat(question, repeat, index number) now but it seems not as reliable.

Be aware no matter what you do if they go back a few repeats and edit values it all falls apart on you.  Not much you can do about that.  

Bec
by
Frequent Contributor

@DougBrowning 

I pointed out already in my initial post that the max function doesn't work for me in a web browser with the survey form.  It will work in preview only.  You can look at my form as I have it attached.  Maybe I have something set up wrong when it comes to the max function, but it did work within preview.  I will look at the indexed-repeat function tomorrow.  Thanks!

Bec

0 Kudos
Neal_t_k
MVP Regular Contributor

This calc for begin_ft appears to work in the web:

indexed-repeat(${end_ft}, ${parking_do}, position(..)-1)  

Bec
by
Frequent Contributor

@Neal_t_k @DougBrowning 

Thank you both Neal and Doug for the assistance!  I tried the indexed-repeat and it definitely works in the web.

Bec

0 Kudos