Survey123- add default image referenced by another field

1179
2
Jump to solution
04-27-2021 11:06 AM
JonahW
by
New Contributor III

I want to be able to include several default images in a survey for hydrant flushing. Each day the operator selects a flushing day (M-F) and I would like to be able to display a .JPG that shows the workflow for that particular day. Is there a way to construct the name of the image in the media::image column using the answer from another question? So for example, I use a select_one to capture the flushing day. Can I use this value somehow to display the corresponding .JPG I have created in the media file? 

I tried using ${flush_day}.JPG in the media::image column but that didn't work.   Can I use an if statement somehow? I have 10 different schedules (M-F, and two crews). Would I need to do that in a separate calculate question first? 

 

Thanks!

 

0 Kudos
1 Solution

Accepted Solutions
Jim-Moore
Esri Regular Contributor

Hi @JonahW 

The media::image column accepts a file name (with extension) only - you cannot use expressions in this column.

One way to approach this would be to have a separate note question for each image, then use an expression in the relevant column to show the note that corresponds to the selected flush day, e.g. ${flush_day} = 'Monday_1'.

Another approach would be to include an image for each choice in the FlushDay choice list by adding file names to the media::image column on the choices sheet; this will show the image as a thumbnail alongside each choice for the select_one question. Tapping/clicking on the thumbnail will open it in full-screen. Note that file names are case-sensitive in XLSForm so be sure to enter these exactly.

Check out the Media sample XLSForm in Connect for a demo and also the Media documentation for more.

Hope this helps! Best, Jim

View solution in original post

0 Kudos
2 Replies
Jim-Moore
Esri Regular Contributor

Hi @JonahW 

The media::image column accepts a file name (with extension) only - you cannot use expressions in this column.

One way to approach this would be to have a separate note question for each image, then use an expression in the relevant column to show the note that corresponds to the selected flush day, e.g. ${flush_day} = 'Monday_1'.

Another approach would be to include an image for each choice in the FlushDay choice list by adding file names to the media::image column on the choices sheet; this will show the image as a thumbnail alongside each choice for the select_one question. Tapping/clicking on the thumbnail will open it in full-screen. Note that file names are case-sensitive in XLSForm so be sure to enter these exactly.

Check out the Media sample XLSForm in Connect for a demo and also the Media documentation for more.

Hope this helps! Best, Jim

0 Kudos
JonahW
by
New Contributor III

Hi Jim,

Thank you for your suggestions! I actually did try the second option you mentioned and it worked well, but I might try the first approach as it would not require the operator to click on the image. Plus keeping the schedule visible while filling out the survey is what I was after. 

Thank you again! 

Alina