Select to view content in your preferred language

Populate field with photo filename

3404
9
06-28-2018 09:49 AM
peterbrad2
New Contributor III

Is it possible to populate a text field using the photo filename survey123 assigns to a photo that has been captured?

For example, say I take a photo and survey123 assigns the following name image-20180627-210709.jpg, can I populate a subsequent text field with that filename? I keep getting requests at work for the reports to contain not only the image but also the image name.

9 Replies
IsmaelChivite
Esri Notable Contributor

While it is not possible to capture the filename as a GIS attribute through an XLSForm calculation, you can incorporate the following into a Custom Feature Report:

${imagequestion | getValue:"name"} returns the filename

To learn more about Custom Feature Reports, have a look at this blog post: https://community.esri.com/groups/survey123/blog/2017/07/26/introducing-custom-form-report-templates... 

Obtaining the filename of an attachment (Signature, Photo, Annotate) would be a logical enhancement to add. I will add to our backlog.

MarkSchiavone
New Contributor

${imagequestion isn't recognized by Survey123 and it rejects any document template with that term. However, using

${Photo | getValue:"name"}

works perfectly. When working with multiple photos within a #PhotoGroup ... /PhotoGroup loop, just remeber to place ${Photo | getValue:"name"} within the loop (ideally, either before or after the ${Photo } tag.

BryceHancock
Occasional Contributor

Has an update been issued to allow capture of the photo filename in a Survey123 form field? We would like this feature for our forms too. Thank you.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Bryce,

You can record the filename in another field by having a calculation that refers to the image question - see the attached sample.

CaseyJustice
New Contributor II

Thanks a lot for adding this functionality. Very helpful and easy to implement.

0 Kudos
FRSadmin
New Contributor III

I must be doing something wrong, because me simply copying ${image} into the calculation field is yielding me an error.. pull function?

0 Kudos
trashbaby
New Contributor II

Is it possible to include more than image name in the calculation?

I want a field that includes all of the image names for the entire survey, separated by commas.

0 Kudos
SMH-Rio
New Contributor III

One problem with this solution is that, if the user renames the file after uploading it to Survey123, the question does not update the calculation, that is: it continues to store the old name. I did some tests with concat, "+", "join" and the result was always the same.

I know that custom image/file names that reference a question changed after upload don't update, but in this case the file name doesn't have any calculations: I simply renamed it after upload.

I imagine there is no way for a question to update the calculated value if the user renames the file in the WebApp. Am I right?

0 Kudos
FRSadmin
New Contributor III

Hello @JamesTedrick Has there been a different implementation of this?

I have not yet implemented this into our surveys, but our environmental team takes many photos, can this be done with one text field? Where the image names are separated by commas, or do you need one text field after every photo?

0 Kudos