Select to view content in your preferred language

How to access media::image in a Report?

489
4
Jump to solution
02-15-2024 03:48 PM
JoeBryant1
Occasional Contributor III

I'm trying to place images stored in the Media folder on my Report template. The image would be displayed if the inspector chose that displayed image from a select_one choice question. (I am using the media::image field in my choice list to specify the image file). All of the examples I am finding are for placing the attached image from an image question in the report.

Does the Survey123 Report have access to the Media folder for a form?

I'm thinking the syntax in the word document template for my report should be something like:

${if Inspector | selected: "Hancock"} ${ Inspector | get{media::image} | size:400:0} ${/}

Or maybe I can call the media file name directly from the folder? I tried this:

${if Inspector | selected: "Hancock"} ${JohnHancock.png | size:400:0} ${/}

But I get:

Failed to parse ${JohnHancock.png | size:400:0} since png cannot be found in the current parsing scope.

FYI: I am sideloading higher resolution image files of my inspector's signatures to the form for use in the report, as they find the appearance of the Signature question to be too sloppy when it appears on our final reports.

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Regular Contributor

I would assume that they are published as a component of the "Form", then extracted from there by the app. So, they wouldn't be individual items on the Portal that you could reference. That is of course, unless you manually upload them there.

abureaux_1-1708455996721.png

In my Feature Report, I use IF statements to dynamically show the images (which are stored in the DOCX)

abureaux_2-1708456115603.png

 

View solution in original post

0 Kudos
4 Replies
abureaux
MVP Regular Contributor

Have you had a look at Feature Report Templates yet? Specifically, Images and Other Media.

As far as I am aware, you can't pull something from S123 media folder and use in a Report Template. However, you can add images to the report template and have them dynamically shown. You would just nest the image inside of an IF statement.

0 Kudos
JoeBryant1
Occasional Contributor III

I have looked at that section. My current, less than optimal, solution is to call the $image | src: expression within my IF statement. This works for now with a small number of users, but is not very scalable. I have to load the images to BOTH the Media Folder in Survey123 connect and update the survey choices with the media::image name, AND I have to publish the images as items in our ArcGIS Online organization, then update the Report code to use the generated item URL. It would be preferable if I could just call the media::image file in the report, since it has already been published to ArcGIS Online along with the form. I just don't know where the Media folder files get hosted when you publish a Survey123 form.

Should I make this an enhancement request? Are we sure there is no way to access the Media folder files in ArcGIS Online?

0 Kudos
abureaux
MVP Regular Contributor

I would assume that they are published as a component of the "Form", then extracted from there by the app. So, they wouldn't be individual items on the Portal that you could reference. That is of course, unless you manually upload them there.

abureaux_1-1708455996721.png

In my Feature Report, I use IF statements to dynamically show the images (which are stored in the DOCX)

abureaux_2-1708456115603.png

 

0 Kudos
JoeBryant1
Occasional Contributor III

LOL! I was not making this logical leap! You can paste the image right into the doc in the conditional statement the same way you enter a text string. No calling of external media required. And you can get the format/size perfect without having to guess at pixel width.

That is better than publishing the image as an item in ArcGIS. Thanks for pointing this out!

I'll mark this as the solution with the clarification that the answer is "No, you can't access the Media folder from the form, but you CAN do this."