Pulldata() photos

2046
4
03-22-2019 08:56 AM
OliverJefferies
New Contributor

I'm trying to standardise a question form that allows users to enter information about a structure (name and photo), the pulldata term then loads this information into the question form so the user can then answer questions about a structure.

I've got this to work for the name, but not the file path. The photo file path is loaded in and stored as a variable,I've put the variable in the images column to try and load that file path (as it changes often), but this doesn't seem to work.

It seems that the photo is loaded at the start of the form, before the variable is assigned. Has anyone had any experience with this before?

Thanks - any advice would be useful.

Tags (2)
0 Kudos
4 Replies
Jim-Moore
Esri Regular Contributor

Hi Oliver

Would it be possible to share your XLSForm so I can see how your survey is structured?

Some general info on images: To include an image in your survey it must be saved in the media sub-folder of your survey project. An image can also be submitted in your survey using an image question. Detailed information on using images in surveys is available here: https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformmedia.htm

Best regards,

Jim

0 Kudos
OliverJefferies
New Contributor

Hi Jim,

I am trying to design a structure inspection tool that allows users to add in a photo and name for each structure into an excel workbook, the survey form then reads this into the survey and publishes the form. The user can then select the structure and see the photo and name of it.

I want this to be flexible so users can add whatever structures or photos they want - they're also not experienced in using S123 so I don't want it to be in the survey form excel workbook itself but more a separate 'simplified' workbook that the main form 'pulls' data from.

Any assistance would be greatly appreciated.

https://community.esri.com/docs/DOC-13153-structure-testxlsx

https://community.esri.com/docs/DOC-13154-structuresxlsx

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Oliver

Thanks for the files and additional info. The media::image column accepts an image filename only (including its extension). Calculations or references to other questions will not work in this column. Image files must be stored in the media folder and published with your survey. The same applies to the image column on the choices tab.

One way to display an image in a note contingent on a previous answer would be to have a separate note for each, and make each of these notes relevant based on the previous answer. With this method the complete list of structures would have to be specified on the choices tab, and the images would have to exist in the media folder of your survey. Alternatively, add the image filenames to the image column on the choices tab; the user will then see a thumbnail image alongside each choice on the form.

If users are going to specify a new structure name and add a photo for each survey response, the survey could ask for these using text and image questions.

Also I notice your Structures file is an Excel document; it must be in CSV format to work with pulldata. As with images, this CSV file is stored in the media folder and published with your survey, so any changes to it would require the survey to be republished. For more information on using pulldata please see: https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm

Hope this helps! Best regards, Jim

0 Kudos
MatildaOkuneva
New Contributor

This is a really clever idea - I'm not sure if I've seen anything like this before. It would be great to see how it works in practise! As for the question of the photo file path, have you tried using a function to assign the value of the variable? Something like:

photoFilePath = function(){

return "C:\\Users\\Public\\Pictures\\Sample Pictures\\Test.jpg";}

This way, the value of the photo file path would be assigned when the function is called, rather than when the form loads. Let me know if this works or if you have any other questions! 🙂 

0 Kudos