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.
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
Solved! Go to Solution.
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.
This calc for begin_ft appears to work in the web:
indexed-repeat(${end_ft}, ${parking_do}, position(..)-1)
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.
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
Thank you both Neal and Doug for the assistance! I tried the indexed-repeat and it definitely works in the web.
Bec