Survey123 Report Multiple Images

1842
6
04-20-2022 02:49 AM
GriffithsDanielT
New Contributor II

Hi All

I am new to Survey123 and recently set up my first survey and associated report template. The survey includes an image question which allows submission of multiple images up to a maximum of 5. On my report template I can return all of the images and their locations with the following syntax:

${#photo_of_feature_oppertunity}  (This is the question name)

${$file | size:200:200}

Location – x: ${$file | getValue:"x" | round:5} y: ${$file | getValue:"y" | round:5}

${/}

Is it possible to return a specific image in the report, and also the additional information associated with that specific image (location) rather than all of the images? I have tried using 'file1', 'attachment1' or 'image1' in the syntax to try and identify the first attachment but it returns the following error:

GriffithsDanielT_0-1650448067513.png

If this isn't possible with questions allowing submission of multiple photos will just look to change my survey design for future use,

Thanks,

Dan

0 Kudos
6 Replies
Katie_Clark
MVP Regular Contributor

Hi Dan,

As far as I know, you aren't able to extract a specific photo within a repeat without getting all the photos. Since you know you have a maximum of five photos, I think your best bet would be to have individual questions for each photo, then pulling the photo into the report with a direct reference to that field name.

Best,

Katherine

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
abureaux
MVP Regular Contributor

You could try something like this:

 

${if (repeat_name | getValue:"position")==1}

 

I haven't tested this, but it should work in theory.

 

 

I stole this next paragraph from https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereporttemplates.htm:

To display the index of a repeat record, use the getValue expression with the reserved keyword $feature. This example will produce 1 for the first record in a repeat, 2 for the second, and so on:

${#defects}
${$feature | getValue: "position"}
${/}
ZhifangWang
Esri Regular Contributor

$file and $attachment are reserved keywords, so 'file1' and 'attachment1' cannot work as expected.

 

Can you please share some details about how you would like to filter an image?

 

Currently, using if expression, like mentioned by abureaux, is a way to "filter" a specific image. For example,

${#image1}

${if ($file | getValue:"size")/1024/1024>1} ${$file | size:200:200} ${/} //print image that is larger than 1MB

${/}

0 Kudos
GriffithsDanielT
New Contributor II

Thanks for your replies all. 

What I was trying to do was to return the x and y location values for one of the pictures rather than all. The survey has multiple pictures from a single location, typically looking up and downstream on a river at a given point. I didn't include a map question in the survey so trying to use the report to get values from the photos instead. 

Also for the multiple photos was looking to have several placeholders in the report template to present them neatly, i.e. individual placeholders within cells for each picture rather than them going in as a vertical string. 

I have tried the suggestions above, the report template doesn't like the $image1 tag, it only seems to recognise $file covering all of the pictures:

GriffithsDanielT_0-1650559045067.png

I will amend the survey for future use was just trying to make the most of the data currently collected. 

Thanks again for the replies,

Cheers,

Dan

 

abureaux
MVP Regular Contributor

If your goal is x and y, I don't believe you can extract that from an image in a S123 Feature Report. The x, y, z, wkid parameters for getValue are not supported by image questions, just geopoint.

Here is a post about working with EXIF metadata from images. But this is using pulldata within the survey. https://community.esri.com/t5/arcgis-survey123-blog/working-with-exif-image-metadata-in-survey123-fo...

0 Kudos
GriffithsDanielT
New Contributor II

I can get the x and y values associated with all of the images ok, syntax and output below:

${#photo_of_feature_oppertunity}

${$file | size:200:200}

Location – x: ${$file | getValue:"x" | round:5} y: ${$file | getValue:"y" | round:5} ${/}

GriffithsDanielT_0-1650621129951.png

It just doesn't seem to recognise the files as individual images, so not able to filter them. I think I will change the design of the survey for future use to make the results a bit more flexible,

Thanks again for the replies,

Dan

0 Kudos