Select to view content in your preferred language

Survey123 Tricks of the Trade: Photos

60398
64
08-06-2020 06:31 PM
IsmaelChivite
Esri Notable Contributor
14 64 60.4K

Updated December 2, 2022 (setFileName property to rename photo file names)

 

Survey123 includes great capabilities to help you specify how photos should be captured from your smart form. The 3.10 release, introduces even more: multiline appearance and the method setting in the body::esri:style column. This blog highlights these new features and a few other techniques so you can get the best out of photos in your smart forms. Most of what is described in this article involves the use of Survey123 Connect and requires familiarity with XLSForms. Check out the Survey123 XLSForm tutorials in YouTube or our documentation if you need to get started.

 

As with many other Tricks of the Trade articles, we will start easy, and progressively explore more sophisticated techniques one step at a time.

 

The Basics: One question, one photo.

 

If you want your users to submit a photo through your smart form, you will include a question of type image. Here is an XLForm example:

 

typenamelabel
geopointlocationIncident location
imagephotoPhoto of the incident

 

Like any other question type, you can use the required column to define if the end user must submit data for your question or not. In the next XLSForm example, an expression is used in the required column to determine if a photo must be submitted. If the severity of the incident is high, then a photo must be submitted. Otherwise, the photo question will be presented to the user as optional.

 

typenamelabelrequired
geopointlocationIncident location 
select_one severityseveritySeverity 
imagephotoPhoto of the incidentselected(${severity},"high")

 

Controlling the source of the photo: Camera versus browse

 

By default, the Survey123 web and field apps will let end users either take a new photo using the camera or browse for an existing photo in the device. Sometimes, you want to have control over the source of the photo. If you are designing a survey for inspectors to document code violations, for example, you may want them always to take a new photo with the camera, and not allow browsing of existing photos in the device.

 

The method parameter in the body::esri:style XLSForm column lets you specify if both methods are allowed, or just one. If the method parameter is set to camera, users will need to capture a photo using the camera. If method is set to browse, users will need to browse for an existing photo. If you want to give users a choice, leave the the body::esri:style column empty or set the method parameter to camera,browse

 

Here is a visual representation of what the user experience looks like using the different method parameter options:

And here is what an XLSForm looks like if you want to force users to submit a new photo from the camera:

 

typenamelabelbody::esri:style
geopointlocationLocation 
imageimagePhotomethod=camera

 

One question, multiple photos

 

If you want users to submit more than one photo with your survey, you can either add multiple image questions or alternatively use the multiline appearance on an image question. There are good cases for both approaches. For now, lets start with the multiline appearance:

 

typenamelabelappearance
geopointlocationIncident location 
imagephotoIncident photosmultiline

 

Support for the multiline appearance for image questions was added in version 3.10. When using the multiline appearance you will initially not see much of a difference in your form. However, after you take the first photo, you will see that new options appear for you to take additional photos and navigate through all the photos you have taken.

 

Counting photos submitted, and limiting how many photos can be submitted

 

The XLSForm count-selected() function can be used to get the number of photos a user has added to an image question. Two common uses for this function are calculations and constraints.

 

The following example shows how you can store as a feature attribute the total number of photos submitted through an image question. Once you have this attribute, you can use it to filter, label or simply set the symbology of features in a web map. For example, you may want to create a filter to hide features with no associated photos.

 

typenamelabelappearancecalculation
geopointlocationIncident location  
imagephotoIncident photosmultiline 
integerphoto_countPhotos submitted count-selected(${photo})

 

Using count-selected(), you can also also control how many photos can be submitted with a question. For example, you can setup a constraint to limit photos submitted with your image question to less than 5:

 

typenamelabelappearanceconstraint
geopointlocationIncident location  
imagephotoIncident photosmultilinecount-selected(${photo})<5

 

You can use count-selected() against an image question with and without the multiline appearance.

 

Image questions and repeats

 

Support for the multiline appearance in image questions was added with version 3.10. Before that, if you wanted users to upload more than one photo you had to either add multiple image questions to your survey or include the image question within a repeat. Adding multiple image questions in a survey is still a valid pattern, as we will describe later. Creating a repeat block simply to include a single image question is never a good idea, because the repeat will create a new related table and your attachments will link to that table. It will be extremely difficult for you to later explore the attachments in ArcGIS that way. Instead of using a repeat for that, use the multiline appearance as described above.

 

typenamelabelhint
geopointlocationLocation 
begin repeatphotosPhotosDo not create a repeat just to add a single image question in it. Use the multiline appearance instead on the image question (as shown above)
imagephotoPhoto 
end repeat   

 

For clarity, this is not to say that you should not include image questions within a repeat. For example, If you want to have a repeat and then add an image question along with a text question for a description or something else, that is all good. It is adding a repeat containing just an image question that should be avoided.

 

Here is an example where having an image question within a repeat is justified. In this case, the repeat makes sense because we want to associate multiple attributes (Direction, Latitude, Longitude as well as a user entered description) with every photo.

 

typenamelabelcalculationbind::esri:fieldType
geopointlocationLocation  
begin repeatphotosPhotos  
imagephotoPhoto  
textdesDescription  
calculatedirDirpulldata("@exif", ${photo}, "GpsImgDirection")esriFieldTypeDouble
calculatelatLatpulldata("@exif", ${photo}, "GpsLatitude")esriFieldTypeDouble
calculatelonLonpulldata("@exif", ${photo}, "GpsLongitude")esriFieldTypeDouble
end repeat    

 

Note that photos in the repeat table have attributes to extract their direction, latitude, longitude and even a user-entered description of the photo. Storing all these attributes for every one of the photos would not be possible using the multiline appearance in the image question. This is what justifies the use of the repeat.

 

If you are not familiar with the pulldata("@exif") function check the https://community.esri.com/groups/survey123/blog/2017/12/12/working-with-exif-image-metadata-in-surv...  blog post.

 

One survey, multiple photos

 

It is possible to include multiple image questions within a single form. Note that adding multiple image questions to a form is very different from enabling multiple photos in a single question.

 

The Virginia Department of Agriculture and Consumer Services (VDACS) was notified in early 2020 that many residents in the State had received unsolicited packages containing seeds from an unknown source. To better understand the extent of the problem, a survey was put together for Virginia residents to submit reports of unsolicited seed packages. In this survey, one question was added to capture a photo of the front of the envelope, and a separate question for the back of the envelope.

 

 

Rather than asking users to take one or more photos of the envelope in a single question with multiline appearance, this survey uses two separate image questions. This gives more explicit direction to the user, which generally is going to yield better data.

 

typenamelabel
imagephotoFrontFront of package
imagephotoBackBack of package

 

An additional advantage of using multiple image questions is that each of the photos will be automatically tagged by Survey123 with the name of the corresponding image question. This later on will be an advantage when you want to put your photos into a Survey123 report. Since the front and back photos are tagged differently, you will be able to specify where exactly each of the photos should go.

 

Using multiple image questions within a form is a good practice when you want to explicitly tell users what each photo should contain. In the Virginia seeds use case above, you are telling users to take a photo of the front of the envelope first, and then a photo of the back. This is a good use case. If you want to simply want to open up the possibility of submitting multiple photos of something, then the multiline appearance is the way to go.  For example, say you want people to submit multiple photos of an issue in an asset. You do not know in advance what exactly the end user will report, but you want that user to be able to submit a few photos; that is a perfect example for multiline.

 

Since the multiline appearance was not available in the past, some of you created surveys with multiple image questions as follows:

 

typenamelabelhint
geopointlocationLocation 
imagephoto1Photo 
imagephoto2PhotoDon't do this. Use mutliline appearance in photo1 instead
imagephoto3PhotoDon't do this. Use mutliline appearance in photo1 instead

 

Now that the multiline appearance has been added, it is time to adjust the XLSForm design accordingly. Remember you can also use the count-selected() function to limit the number of photos that you want people to submit. Removing the extra image questions in your form will not cause data loss, however, keep in mind that the multiline appearance is only supported in Survey123 3.10 or newer, so you will want end users to be up to date with their app version or otherwise the appearance will be ignored.

 

Controlling the size of photos

 

Using Survey123 Connect, you can control the size of photos sent to ArcGIS. There are a number of devices out there and each of them may send photos of different sizes. You can bring consistency by properly configuring your survey from Survey123 Connect.

 

In Survey123 Connect, go to the Options tab of your survey and scroll down until you see the Images section. Use that setting to control how big you want images to be when sent to ArcGIS. The default value is 1280 pixels on the largest edge, which generally works well for most workflows, the quality is good and the size of the photo is manageable.  However, you can reduce images down to 320 pixels or leave them in their original size.

 

IsmaelChivite_0-1654534904705.png

 

The Survey123 Connect setting above applies to all image questions in your form, unless you overwrite this value with the max-pixels parameter. As you can likely already tell, the max-pixels parameter controls the image size on the longest edge at the question level.

typenamelabelparameters
geopointlocationIncident location 
imagephotoIncident photosmax-pixels=600

 

Photo filenames

 

Survey123 automatically assigns a unique filename to photos. The filename includes as a prefix the name of the image question and it is followed by a unique number. If you want to persist the name of your photos as a GIS attribute, use a calculation as shown below.

 

typenamelabelappearance
calculation
imagephotoPhoto of the incident  
textphoto_filenamePhoto filenamehidden${photo}

 

If you want to set the name of the photo file yourself, you can. You will use the fileName property in the bind::esri: parameters column for that. 

 

typenamelabelbody::esri:parameters
imagephotoPhoto filename=concat("Photo_",format_date(now(),"%y%m%d%H%M%S"))

 

Check this help topic or this blog, for more details on how to set the fileName property.

Photos in reports

 

Survey123 includes a powerful report service which you can use to create high quality reports in MS Word and PDF format. Check https://community.esri.com/groups/survey123/blog/2019/07/23/understanding-survey123-feature-reports for an introduction to this service.

 

Survey123 reports require you to create a template specifying the content and look and feel of your report. These templates are authored as Microsoft Word documents where you insert placeholders to fetch data from your survey records. The full syntax for report templates is described at Feature report templates—Survey123 for ArcGIS | Documentation 

 

In regards to photos, you can control the size of the photos in your report and even where to put each of the photos from your survey. This is where using mutliple image questions can really pay off.

 

For example, the following syntax in a report template will insert into your report the photo corresponding to the incident_photo question in your form. The photo will be added to the document with a width of 300 pixels and the height will grow proportionally to preserve the original aspect ratio.

${incident_photo | size:300:0}

If you used the multiline appearance in your survey, you will want to use the following syntax to arrange all photos vertically within your report:

${#incident_photos}
${$file | size:300:0}
${/}

This syntax will arrange the photos horizontally (note that I adjusted the width to 200px to have images fit within the width of the page).

${#incident_photos}${$file | size:300:0}${/}

Unfortunately, as of the time I write this, it is not possible to arrange photos in a table (each photo in its own cell). Mike Onzay‌ figured that adding a space right before the closing tag would add a nice separation between photos. That is pretty clever! Thanks Mike for the tip! Here is the same expression with the space added:

${#incident_photos}${$file | size:300:0} ${/}

 

Photo Watermarks

 

Photo watermarks is a neat feature in Survey123. Since this article is about photos, I thought I would bring it up, although there is a separate blog covering this topic https://community.esri.com/groups/survey123/blog/2019/08/08/survey123-tricks-of-the-trade-photo-wate... 

64 Comments
erica_poisson
Frequent Contributor

This is great! Just a heads up, the instructions on updating report template syntax to deal with multiple photos per image question is different than it is stated above. I could not get the syntax above to work, however the syntax from the report template help did work:

IsmaelChivite
Esri Notable Contributor

Thanks Erica. I made the correction in the blog.

PaulSweeney3
Frequent Contributor

HI Ismeal 

These are welcome additions to the app especially the method option however just a couple of points 

  • Why does it default to the method=camera option if the column is blank i would have thought the original setting of both options would have been a better option here. this is  affecting older forms which now have to be updated to ensure both options are available
  • Seems to be a bug in some android devices where the camera will not switch to the rear view camera from selfie  when taking a picture. Using new-rear in the appearance column is a workaround but if you switch to selfie again it will not switch back until you go back out and in again it. new-rear is not in Survey123 documentation as far as i can see. I raised this with support 

Regards 

Paul 

AnthonyJonesRSK
Frequent Contributor

Hi Ismael,

The ability to add multiple photos using the multiline appearance is a great enhancement. Are there any plans to make this work in the inbox? I've just tested it on a survey and in the inbox the photo question isn't available. I've got round this previously by using the repeat method, which, as you say, isn't ideal but allows our users to add additional photos. If the multiline appearance allowed extra photos in the inbox it would be a really welcome addition.

Thanks

Anthony

PaulSweeney3
Frequent Contributor

Sorry a  mistake on my part in relation to my first point above   i realised that when i use the new-rear appearance option  it removes the option for upload  from gallery and you must then use the method options to get it back.

MikeOnzay
Frequent Contributor

It is not clear to me how I can use the feature report syntax to display photos from an image question with a multiline appearance "to perfectly control how photos in your report are placed." When I used the syntax, with or without a table, the two photos from my question were placed vertically on the page. Placing the syntax in a table created a new row but still placed them vertically. Is there a way to place the photos horizontally?

image syntax in a table

multiline photos in a table

IsmaelChivite
Esri Notable Contributor

Hi Anthony.  Supporting images in the Inbox is something we want to look at, although at the moment we have not associated this work in our immediate plans.  Unless we find technical limitations to implement this, our intent is to start work on this before the end of this year.

If not already:

IsmaelChivite
Esri Notable Contributor

Mike Onzay

You have a good point. Using "to perfectly control how photos in your report are placed" was an overstatement on my side and a lazy way to close the blog. I guess at the time when I wrote it I was close to dinner time and wanted to give the blog a quick close. I just changed the wording to this:

If you used the multiline appearance in your survey, you will want to use the following syntax to arrange all photos vertically within your report:

${#incident_photos}
${$file | size:300:0}
${/}

This syntax will arrange the photos horizontally (note that I adjusted the width to 200px to have images fit within the width of the page)

${#incident_photos}${$file | size:200:0}${/}

MikeOnzay
Frequent Contributor

Thanks, Ismael. I found that if I put a space or two before ${/} it separates the photos with spaces. It looks cleaner than having the photos jammed up against each other. Is it possible to put each photo in its own table cell? This is as close as I could get.

multiline photos in a table syntax

multiline photos in a table 1 output

GarethBaker1
Frequent Contributor

Using count-selected(), you can also also control how many photos can be submitted with a question. For example, you can setup a constraint to limit photos submitted with your image question to less than 5:

I wanted to understand if the constraint is checked at the point that the survey record is submitted rather when photos are being taken/added?

Just that I have set up a constraint to limit the number of photos to 3 but the interface (at least within Connect) will allow me to go through the process of adding a 4th and 5th photo (presumably I could keep on going) and it is only when I come to submit that it says the answer is invalid.

I can put a note above the question to say don't add more than the given number but ideally it would prevent the user from adding more than the constraint.

IsmaelChivite
Esri Notable Contributor

Hi Gareth Baker‌  Constraints are guaranteed to be checked before you send the survey. If you would like immediate feedback, your idea about showing a note is great. Using the relevant column, you can keep the note hidden until the user has uploaded the maximum number of photos. You can also format the note in red to make it more prominent.

IsmaelChivite
Esri Notable Contributor

Hi Mike! For now, I think what you have, with the space, is the best you can do. I did try myself putting the images in a cell, but it did not work for me. Adding the space is pretty clever!

lah
by
Regular Contributor

Hi Ismael, 

Do you know if it is possible to use this "Multiline" photo appearance type along with the "Annotate" appearance type? Or, I'm assuming, would we still need to this the old way if wanting our users to submit multiple photos with annotation? (i.e. photo1, photo2, photo3)

Thanks,

Larissa

GarethBaker1
Frequent Contributor

Hi Larissa,

You should be able to specify both appearance types with a space in between 

Regards

Gareth

Jeff_VanEtten
Regular Contributor

Very useful article thanks for adding this.  We are still struggling though with the inbox / sent items and pulling back photos.  I was looking to implement the repeat solution, but my survey is setup with a style of theme-grid.  when using a repeat on this item, the icons for camera and file appear below the grid and you can't access them sometimes.  Is there anyway to adjust the grid height?  This renders the survey unusable now.  Any suggestions?

IsmaelChivite
Esri Notable Contributor

Hi Jeff,

  • Photos in the Inbox. This is still in our backlog. At this moment, it is not possible to load photos in the Inbox. 
  • Repeats: I am guessing you are using a repeat so you can fetch records in the Inbox, then add photos within the repeat and then submit. Is this the case? Or are you using the repeat to allow people to submit more than one photo at once?  If you use the repeat to simply let users add more than one photo at once, I would strongly recommend using the multiline appearance.
  • Grid: The issue I see above is that you configured the group with w6 and only allocated a w1 for each of the repeats.  Can you go with w3 for the repeats? This will give them extra space to render correctly.
NicholasDay
Occasional Contributor

I love the updates and direction photos are going. I'm also glad to hear the way we set up our photo repeat is also good to go. I recently noticed our photos stopped capturing the direction after SEPT 8, 2020. I don't know if the updates caused the break or something else but after experimenting I found a solution.

 

In the blog you reference the pulldata() function. In this example you use a calculate type. 

We were using an integer type, to allow users to manually correct the information when the device compass was wrong; this often occurs as you transition and the device fails to know which direction is up.

After a few failed attempts at adjusting the calculation, such as trying to point to the compass, I changed the field type to decimal and rounded to 0 places.

Whatever the issue was, here is an option for others who may have experienced the issue.

UPDATE: I didn't notice it at the time, but I inadvertently changed the calculation from "GpsImageDirection" to "GpsImgDirection" and this was the key to the fix. Event though all the posts say to use "GpsImageDirection" it is actually "GpsImgDirection" that works now. No need to change field types, just fix the calculation.

MJBiazar
Esri Contributor

Hi @MikeOnzay 

I know it's been a while since you posted on this blog but I've done some tests with a sample survey to find a way to put each image in a separate cell while placing them horizontally. After attempting different formatting options, I couldn't find a way to use tables with a horizontal placement. As you can see in the screenshot below, you can use a table and put each image in its own cell but the only possible layout will bi vertical arrangement. 

However, using a border instead of a table, you can get images separately in a border in a horizontal placement. Although it's not technically a table and may not look exactly the same as what you were looking for, but might be a little bit closer.

MJBiazar_0-1615659735638.png

MJBiazar_1-1615659745772.png

 

All the best,

MJ

 

 

TregChristopher
Frequent Contributor

@IsmaelChivite your guide  for creating a count of attached photos works great when submitting a new record (snippet below) but when the user edits the survey (from the inbox) the attachments aren't editable (which I know is a known issue, that you all are working on) but the problem is that the record count also gets reset to null (or zero).

integerphoto_countPhotos submitted count-selected(${photo})

This is a similar problem to other "in form only" workarounds we use (e.g. calculating on non-relevant field) that work on first submission but then do unexpected things when editing a previously submitted record.


I'm wondering if there is some check in Survey123 that we can use to auto-detect whether the record is new vs in "edit mode"? We can then check for the mode to modify you phot count example to something like "if([new mode],true),count-selected(${photo})". This mode check would also help with other calculations and relevant conditions that give different results when editing.

screenshot of new record before submission

TregChristopher_0-1616619395802.png

 

screenshot of editing record from inbox

TregChristopher_1-1616619486565.png



MJBiazar
Esri Contributor

Hi @TregChristopher ,

You can use pulldata("@property", 'mode') or pulldata("@property", 'status') to check if user is accessing the form in edit mode or where a survey was opened. Then, you can use the result in a relevant expression for the photo count question on your form. 

Best,

MJ

MikeOnzay
Frequent Contributor

Hi @MJBiazar,

Thanks for your suggestion. I tried it and it doesn't look that bad. 

repeated images in report horizontally.JPG

Mike

TregChristopher
Frequent Contributor

Yes, thanks!  It's been awhile since I looked through those formulas and had never used those particular, pulldata options before.

Below are screenshots of getting the form mode and using the form mode to change behavior on "PhotoCount" and "IsAttachment" field...probably could be simplified more but works for now.

TregChristopher_0-1617753398193.png

TregChristopher_1-1617753634635.png

Spoke to soon...there is a mistake in the final calculation above (where the IsAttachment field should equal yes (10 as domain code) when at least one attachment created. If Photocount is null instead of 0, the calculation will result in "No" for IsAttachment. To trap for null, use coalesce in calculation to force it to zero from null: if((coalesce(${PhotoCount},0)>0),10,20)

 

 

 

VaLoyBriscoe
Emerging Contributor

I have 8 image questions in my survey. Each question is limited to 5 photos. The first image question is working, allowing more than one photo. The other 7 image questions are set up the same in my XLSform but are only allowing one photo when using the field app. Below are the only fields with text.

MultiplePhotos.JPG

MJBiazar
Esri Contributor

@VaLoyBriscoe 

As I can see in your screenshot, all your questions should allow more than 1one photo as they are using "multiline" appearance. However, the constraint for all questions seem to use the number of photos submitted to the first image question ("${photo}"). This shouldn't affect your ability to add more than one image to other questions though.

I've tried to replicate your survey on my end and I cannot reproduce the issue you are experiencing. In field app, all my image questions allow adding more than one image. 

2021-04-07_12-40-04.jpg

2021-04-07_12-41-48.jpg

 

However, in web app, I noticed that the image questions with constraint only accept one image. As you can see in the image below, only "photo3" question that does not have constraint allows multiple images.

2021-04-07_12-40-41.jpg

 

A defect has been logged against this behavior in web app which is currently under review.

Best,

MJ

 

VaLoyBriscoe
Emerging Contributor

@MJBiazar Thank you for your response. I figured out that it is a Survey123 Connect version problem. I remote login for work, that computer is using 3.12.230. This is the version I was having problems with.

My computer at home is using 3.9.120. This version's XLSform was missing the "multiline" in the appearance column. When I added it the multiple photos in the field app worked for all the appropriate questions. This version was used to create the original survey. 

Hope this helps and thanks again,

VaLoy

JessicaJThompson
Frequent Contributor

Thank you for all of the additional information.

I am looking for clarification on the 10MB file information provided:

JessicaJThompson_0-1622124510571.png

When its states that the "maximum files size for an individual attachment" is 10MB, is one attachment 1 question, or is it that all photos from multiple questions are being submitted as 1 attachment? So in total the photos need to be less than 10MB combined?

 

Thank you for clarifying. I want to make sure the survey I am setting up for a department doesn't run into any photo glitches. 

 

Appreciated,

Jessica Thompson

MJBiazar
Esri Contributor

Hi @VaLoyBriscoe

Thanks for sharing your findings. Yes, the multiline appearance for image questions was introduced in 3.10 version. 

I'm glad to hear that you were able to get the issue sorted out.

Best,

MJ

MJBiazar
Esri Contributor

Hi @JessicaJThompson ,

That's correct! The 10 mb limitation applies to each attachment. For instance, if you have an image question with multiline appearance, you can upload two (or more) images that each has 9 mb size (total of 18 mb). 

So as long as each individual attachment is smaller than 10 mb, you should not hit this limitation. 

Best,

MJ

HayleighFisher
Regular Contributor

Hello,

Our group has a survey where the users may be adding 100-200 attachments per inspection, is it possible to store these photos on a network share drive instead of in our DB? Or is there any recommendation for managing thousands of attachments without compromising performance? 

 

Thank you,

Hayleigh 

FedericoRiet_Sapriza
Occasional Contributor

Hi

I'm using Survey123 Connect to design my survey, and then using S123 web app to collect the data.

I would like to have one image question to collect max 5 photos, I'm using multiline but I cannot limit the number of photos, if a use constraint it won't work in S123 web app as mentioned by @MJBiazar in this blog.

I haven't find a solution this issue.

Thanks

Cheers,

Federico

 

 

 

@IsmaelChivite @MJBiazar 

LeahSperduto1
Emerging Contributor

This functionality is great!

We have a new effort underway to use the multiline image capability using an attachment table in our surveys.  We are able to successfully use the multiline appearance with the images following the above post.

We are unsuccessful, however, in getting other fields to show up from the attachments table for editing; ie: in the example given using repeats.  The example given in the post shows a description field being available for update...Are there any other bind fields that need to be used or added to in order for these additional fields to be usable with the images?  Does the “name” field for the begin repeat need to contain the name of the attachment table (I have underlined it in red)? 

LeahSperduto1_0-1624469663213.jpeg

LeahSperduto1_1-1624469755097.jpeg

The service we are using is an agol service federated from our SDE.  I continue to get the error that “Table exc_inspection__ATTACH not found”.  I have tried this with both the “multiline” active and inactive for the image field with no success.

Any thoughts?

Thanks in advance!

Leah Sperduto

bhartzell
Emerging Contributor

Hi @IsmaelChivite , @MJBiazar 

We have an agol service federated on our SDE.  I have created a survey with multiple photos collected within a repeat.  There is only one photo (potentially) for each question within the repeat.  The survey is working well and the data are synced to our SDE. I have multiple records in the related table associated with the repeat.  I can view the photos in the SDE service. But when I create a file geodatabase in order to export the photos, only the layer data (and no photos) is exported. 

Any thoughts?  

Thanks,

Brauna

AndrewBowne
Frequent Contributor

When adding multiple photos using the multiline appearance type, does anyone know of a way that you can label each photo in a report with it's position in the repeat?  For instance, a user may make a comment in the survey that says, "See photo 1" or "photo 2 shows.....".  I'd like to be able to label each photo with their position so when a user looks at the report they will see "photo 1" labeled under the photo.

 

Thanks~

pat_algura
Occasional Contributor

Thanks @MJBiazar for that tip!
Do you have any recommendations on how to display the image name right below the image like this sample?

palgura_j_1-1634616159457.png

Appreciate the help!

MJBiazar
Esri Contributor

Hi @pat_algura ,

In order to add image names, you can use the following in your feature report template to get the image/file name:

${imageQuestionName | getValue:"name"}

 

If you have an image question with multiline appearance (to capture multiple images) you need to use a tag and ${ $file | getValue:"name"} to get the image name:

${#imageQuestionName }

${$file | size:200:0}

${ $file | getValue:"name"}

${/}

 

2021-10-19_0-58-35.jpg

 

For more details about custom report templates, you may refer to the links below:

Understanding Survey123 Feature Reports

ArcGIS Survey123 - Report templates

 

All the best,

MJ

pat_algura
Occasional Contributor

@MJBiazar I see that this is doable if images were placed vertically, but I can't achieve the same when they are setup horizontally. I'm definitely missing something... any recommendations?

palgura_j_1-1634639275833.png

Thank you! 🙂

MJBiazar
Esri Contributor

@pat_algura I understand what you are trying to do now. I've done some testing and but unfortunately, I couldn't find a way to achieve exactly what you need. The closest option that I found is using a table. However, it only works for individual image questions. It still puts images from an image question with multiple appearance in a vertical layout.

 

2021-10-19_9-27-08.jpg

m3
by
Frequent Contributor

@MJBiazar 

However, in web app, I noticed that the image questions with constraint only accept one image. As you can see in the image below, only "photo3" question that does not have constraint allows multiple images

A defect has been logged against this behavior in web app which is currently under review.

 Any word on this?

DerrickWestoby
Frequent Contributor

An observation & a question: 

 

Observation - The Paragraph->Line and Page Breaks->"Widow/Orphan control" setting was causing problems for me when it was toggled on.  My photos were restricted to a max height that should allow 2x rows of photos and the preceding tables to display on a single page, no matter if they were portrait or landscape.  I kept getting the table on one page and my photo(s) on the next page though....even if they were able to fit.  Unchecking this option fixed that issue for me. 

DerrickWestoby_0-1642716740477.png

DerrickWestoby_1-1642716763297.png

 

And a question for @IsmaelChivite or @JamesTedrick -  Is it possible to use a combination of ${image | getValue:"width"} and orderBy with this?  I'd like to print out my photos with portrait orientation first and landscape orientation second and figured I'd accomplish this by printing them out in order of pixel width. (All photos are taken in-app, not attached, so I'm not too worried about mixed image dimensions being attached). 

I'm  trying to do something along these lines, but haven't been able to get it working yet: 

${#image| orderByFields:"image | getValue:"width" ASC" }

${$file | size:0:0:660:600}

${/}

HayleighFisher
Regular Contributor

I believe as of Sept 2021 attachments are able to be viewed and edited via the inbox. However, when trying to use this new capability the attachment section shows as empty even though there is an attachment for that feature in the attachment table. The workflow is as follows

1. User creates feature and adds attachments to main feature class and related child features in a web application

2. Different user opens up that record via the inbox to append more data to the feature in the field. 

3. The attachments that were added in the web application are not viewable in Survey123

Does anyone know how to make this workflow work? I saw online something about having to use attachment keywords but could not find any examples for my given workflow. 

@IsmaelChivite @MJBiazar 

Thank you!

- Hayleigh 

MJBiazar
Esri Contributor

Hi @HayleighFisher,

That is correct! The capability to edit attachments for existing submissions via Inbox was introduced in 3.13. If you do not see the existing data for any of the questions within your repeat, your survey is probably missing query parameter. To load data from the related table (including attachments) in the Inbox, you have to make sure that your survey has been configured properly to allow querying data from the related layers. 

You need to add "query allowupdates=true" in "bind::esri:parameters" column in your XLS form for your begin repeats, republish your survey, and update the survey in field app on your device. This will query the existing attributes from the related table along with the attachments and allows editing. You can find more details about this here: 

 

Also, image attachments may affect how images show up in reports where images that are missing attachment keywords may not show up when ${<image_question_name>} syntax is used in the template. In ArcGIS Online and ArcGIS Enterprise version 10.8.1 and later where attachment keywords are supported, attachments will have attachment keyword as long as the images are added via Survey123 app (field app or web app). However, if attachments are added to a feature through a method other than a survey, for example in ArcGIS Online Map Viewer, ArcGIS Pro, other field apps such as Field Maps, they won't have the attachment keyword.

 

Best,

MJ

HayleighFisher
Regular Contributor

Hi @MJBiazar ,

 

Thank you for the quick response! I have attachments that are in attachment tables for the parent feature. However those attachments are not showing up when the attachments are added from the web application (this is a WAB application, not survey123). Is this not supported? 

 

Thanks,

Hayleigh 

MJBiazar
Esri Contributor

Hi @HayleighFisher,

You can add attachments through different methods including a WAB application, however, only attachments that are submitted through Survey123 app will have attachment keywords that is what Survey123 uses to associate an attachment with a question in your survey. 

The attachments with no keyword (like the ones submitted via a WAB application), won't show up on the survey form when you are trying to edit an existing survey record in Survey123 app (via Inbox or in edit mode in web app).

You can update existing attachments from the REST to add keywords to the attachments that are not submitted through Survey123 app. 

  1. Open the Data tab in Survey123 website.
  2. Click on the record with the image attachment missing the keyword
  3. Right-click on the attached image and open in new tab
  4. Note the attachment id in the URL (in this example, it’s 31): https://services.arcgis.com/Wl7Y2PbjtJs5n/arcgis/rest/services/service_84a27/FeatureServer/0/14/atta...31?token=2fr...
  5. Replace the “attachments/<attachment_id>” with “updateattachment” in the URL. Your URL should look like this https://services.arcgis.com/Wl7Y2PbjtJs5n/arcgis/rest/services/service_84a27/FeatureServer/0/14/updateattachment?token=2fr...
  6. Fill out the form:
  • The Attachment ID is listed in the URL after /attachments (from Step 4).
  • The Keyword is the name of the image question that you want to associate this image with.
  1. Click Update Attachment.
  2. Notice that this image now shows up under the image question in form view and will be printed in the report.

 

MJBiazar_0-1644328267904.pngMJBiazar_1-1644328275865.pngMJBiazar_2-1644328308593.png

 

Best,

MJ

bgomes
by
Occasional Contributor

Hey @IsmaelChivite , 

I Have a Doubt about photo limitations.
I tried the constraint formula that you have posted here.
But it's not working properly. I have limited to less than 3 photos, but survey 123 allows more than that as image bellow:

bgomes_0-1645190169195.png

Do you have some adivice about some workaround??

thanks

MJBiazar
Esri Contributor

Hi @bgomes,

I've ran into a similar issue and I believe it happens only when you reference the image question name in the constraint. Please change your constraint from "count-selected(${photo})<4" to "count-selected(.)<4" and see if it resolves the issue.

Best,

MJ

bgomes
by
Occasional Contributor

Hey @MJBiazar 

Thanks for your quick response.
I did the modifications, but still the same issue.

bgomes_0-1645192384098.png

 

MJBiazar
Esri Contributor

Hi @bgomes

Can you confirm what version of Survey123 Connect you are using? I cannot reproduce the issue on 3.13.251. If you have published your survey from an older version, make sure to turn off the version lock to force using the 3.13 web app. Images below show my XLS form and the same survey in web form.

MJBiazar_1-1645197103507.png

MJBiazar_2-1645197138673.png

MJBiazar_3-1645197189451.png

Please let me know if you still experience the same issue. 

Thanks,

MJ

 

 

bgomes
by
Occasional Contributor

Hi @MJBiazar 


Thanks for your response.

I'm using the 3.13.251 version of survey 123image.

Survey connect not limmit the number of photos.

after publish the form the result was:

1 - Survey web the result is the same as yours.

2 - Field app (version 3.13.246), still not limmiting the number of photos.

The resource of limmiting photos is just for web form?

Thanks

Bruno Gomes

MJBiazar
Esri Contributor

@bgomes Both constraints should work in Survey123 field app (and Connect) as well. The only difference is that while web app validates the responses against the constraints as soon as input (in this case images) are provided, the field app only imposes the constraints upon submitting the form. Therefore, field app allows adding more images than what is specified in the constraint since the image question has multiline appearance, however, it does not allow user to submit the form. 

MJBiazar_0-1645203686584.png

 

 

bgomes
by
Occasional Contributor

Hi @MJBiazar,
You are completly right!
I was trying to limmit directly in Connect without send. My mistake.

thank you so much!