How to get photos and file for single field

I want an option where user chooses what he/she wants to upload photo or a file in single column. If user want to upload photo then image type should come otherwise file option.

Solved Solved
0 4 184
1 ACCEPTED SOLUTION

OK, so you have to keep in mind that, because these are two different types, you can not replace these alternatively under the same column.

However, assuming you need to provide only one picture or file per row, you can work around that with adding another column, so you will have:

  • 1 column for the photo
  • 1 column for the file

Then, you can use the Show_If condition to display or hide, in the form, the column you wish, depending on the one picked by the user.
This way, as soon as one of the field have been completed, the other one will be hidden.

To do so, you need to have this configuration:
3X_4_9_499cb8276af035eeca625f2606ee776e2a431130.png
and show_if conditions:



Said explicitly:

  • Photo column will be shown only if File column is empty
  • File column will be shown only if Photo column is empty
  • If they are both empty ==> they will be both displayed, as far as the user does not provide anything

Please note that the hiding will happen only with Form View.
With Table View, you will have the 2 columns displayed side-by-side.

Hope that helps, let us know if that works for you

View solution in original post

4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @sainikhushdeep

Iโ€™m not sure of understanding your need.

When you set type as โ€œimageโ€, the user will have the choice to use a capture, or an image from device roll.
Type File is more adequate for pdf or so.
Why do you need to use a file instead ?

So I am dealing with both photos and files. If I want to click picture then image type should come. If I want to upload files or multiple photos then file type should come.
Anything I upload whether a file or a picture should come under same column.

OK, so you have to keep in mind that, because these are two different types, you can not replace these alternatively under the same column.

However, assuming you need to provide only one picture or file per row, you can work around that with adding another column, so you will have:

  • 1 column for the photo
  • 1 column for the file

Then, you can use the Show_If condition to display or hide, in the form, the column you wish, depending on the one picked by the user.
This way, as soon as one of the field have been completed, the other one will be hidden.

To do so, you need to have this configuration:
3X_4_9_499cb8276af035eeca625f2606ee776e2a431130.png
and show_if conditions:



Said explicitly:

  • Photo column will be shown only if File column is empty
  • File column will be shown only if Photo column is empty
  • If they are both empty ==> they will be both displayed, as far as the user does not provide anything

Please note that the hiding will happen only with Form View.
With Table View, you will have the 2 columns displayed side-by-side.

Hope that helps, let us know if that works for you

Thank you!!

Top Labels in this Space