Select to view content in your preferred language

Survey123 Question accept file upload or camera input

2290
4
Jump to solution
12-01-2022 11:54 AM
BrandonA_CDPH
Frequent Contributor

Hello - I am trying to design a question and I could use some help.

I need a question that will look like an "image: question on a mobile device (have a button for a camera input) and look like a "File" question on a laptop (allow the user to upload PDF documents). It's fine if both buttons show in each environment, but I am having trouble getting the ability to use the phone to take a photo and upload a pdf in the same question. The user will mostly be using the phone camera method, but occasionally may need to upload a file. I don't mind manually adding the PDF after submission, but that doesn't seem to be working either.

I have tried the following:

  • removing the "method=camera" restriction from the field's bind::esri:style setting in Connect - this got the file selection icon to show up, but will still not allow me to submit with a pdf (invalid file type)
  • making the question type "file" instead of image - solves the file upload issue, but takes away the more important ability to use the cell camera to capture a photo.
  • Uploading the file after the entry is submitted using the Survey123 website's data page - also would not let me select a pdf (invalid file type).
  • having users not add a photo and just type a reference to where the pdf is in our network drive in the "Comments" field - This is serviceable, but then the PDF isn't actually attached to the record for reporting, so someone has to go find the file if that entry gets audited

Attached is the xls file as it currently stands.

Thank you in advance for any suggestions or ideas.

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Hi. I do not think that is possible. An image question is for photos/images. If you want to upload a file, such as a PDF file, you need to use the file question type.  This can be a bit confusing with images because images are files, so you can also upload them to the file question type. But in the end, you can't have a question type that allows you to either take a photo with the camera and also allow you to browser for any file type.

View solution in original post

4 Replies
IsmaelChivite
Esri Notable Contributor

Hi. I do not think that is possible. An image question is for photos/images. If you want to upload a file, such as a PDF file, you need to use the file question type.  This can be a bit confusing with images because images are files, so you can also upload them to the file question type. But in the end, you can't have a question type that allows you to either take a photo with the camera and also allow you to browser for any file type.

BrandonA_CDPH
Frequent Contributor

Thank you @IsmaelChivite, as always, for your knowledge and insight with Survey123. That’s what I was afraid of. 🤷🏻‍:male_sign:

0 Kudos
WILERMJOSEPERAZAPIMENTEL
Emerging Contributor

I’m currently working with FILE type files in Survey123  and I was wondering if it’s possible to rename these files using the value from an input, for example ${InputNameFile}.

Any guidance on this would be greatly appreciated. Thank you in advance!

0 Kudos
BrandonA_CDPH
Frequent Contributor

Possibly. I have some forms that rename photos, but haven't tried it with files. Here's what I have in the bind::esri:parameters column in Survey123 Connect for one of my surveys (bolded for emphasis):

fileName=concat("Prefix", ${Field})

If you just want the file named based on a field, you could use fileName=${Field}

Also, I like to lock things down for consistency, so have used the parameter fileNameVisible=false in the body::esri:style column so that the name can't be accidentally (or purposely) changed by the user.

Hope that helps 😁