Select to view content in your preferred language

Displaying an image with name related to previous choice

635
5
08-07-2023 11:39 PM
ChampionAmaury
New Contributor II

Hello 😊

I am building a Survey123 formular for the maintenance of a piezometer network and I would like to help the operator who will fill the document by displaying an image of the station. The idea is that when the operator select the ID of the station at the beginning of the formular, a photograph of the station is shown in order to help him locating the instrument. 

To do so, I used the column media::image which I filled with the name of the picture in the media folder; XXX.jpg for example. The problem I face is that I would like that the name of the picture changes with the selection of the station. If I select the station AG89, the name of the image in the column media::image must be AG89.jpg. If I select another one, XZ76, the name would need to be XZ76.jpg

For now, I used the command concat to merge the name of the selected station with the suffix ".jpg". That way, I filled the column media::image with 'concat(${StationName},".jpg"). But even if it seems to work for the attribution of the correct name, the photo doesn't appear.

I would be super happy if someone has a solution for me 🤞 !

0 Kudos
5 Replies
ChristopherCounsell
MVP Regular Contributor

This is case sensitive - is the selection value (not the choice label) and extension the same case?

ChampionAmaury
New Contributor II

Hello ! I am sorry but I am not sure I understood well, I don't think the selection value and the extension are the same case.

0 Kudos
abureaux
MVP Regular Contributor

A bug, or a limitation of that column.

abureaux_0-1691509364633.pngabureaux_1-1691509412020.png

 

0 Kudos
abureaux
MVP Regular Contributor

I could have sworn I had an example of doing something similar to this. I found what I was looking for, but probably not helpful to you...

You can use a calculation to show dynamic images in the 'image' question. I was using this so techs could select a room within a building from the drop down and then mark on an image of that room where the samples were collected from.

abureaux_0-1691510316985.png

Again, this is similar to what you are doing, but not as convenient for your use-case (i.e., techs would have to click into the image question to see the picture).

0 Kudos
ChampionAmaury
New Contributor II

Thank you for your answer ! unfortunately, I already tried that solution but that is not the best for what we want. The other solution would be to add all the pictures 1 by 1 in the XLSForm and to add a rule to only display the one that is selected through the column "relevant". But we have 300 stations so I am still hoping I can find an automatic solution ! 

0 Kudos