Select to view content in your preferred language

Use indexed-repeat to pull a read-only image from previous repeat

150
2
a month ago
Chris3030
Emerging Contributor

Hello! 

I am currently creating a survey for an inspection and there is a repeat group with one image type question in it. We would like each repeat (after the first one) to display the image uploaded in the previous repeat so that the user can reference the previous image uploaded without needing toggle back and forth between repeats. I know this is possible for text questions using indexed-repeat and position(..). I currently use indexed-repeat(${desc}, ${inspectionRepeat}, position(..)-1) to pull in the previous repeat's description and it works fine for text, but not when I try to use it for the image question. Is this functionality available for images?

0 Kudos
2 Replies
Neal-Kittelson
Frequent Contributor

I don't think that is possible as you describe. Depending on your form layout you could however have a multiline image question right outside the repeat.  That would allow multiple images to be uploaded and and easy click back to see previous images. Inside the repeat you could still have an image description and have them input the file name and description.

Taking it a step further you could potentially use the indexed-repeat function, the count-selected() function and the bind::esri:parameters field, and try to format a descriptive name for each upload.  Attached is an example that kind of works.

Edit:  The example breaks if there is a file with the same name in your attachments folder.  It goes back to the default name.  It also breaks in Connect if you don't set the file description and tab out of the field before uploading.

0 Kudos
Neal-Kittelson
Frequent Contributor

As a follow up, you can pull the name of a single photo in a multiline image question into a repeat using select-at() and position(..).

NealKittelson_0-1745522303632.png

 

0 Kudos