Automatically upload images and files to Gdrive

Hello, my form has various fields like imags and files. I want appsheet to upload my images and files directly to GDrive while submitting the form and Gdrive link should be pasted in the respective cell in Google Sheets. If there is a solution, please explain in detail because I am new to appsheet and It would be a great help!! Thank You

1 24 1,865
24 REPLIES 24

This is default behavior.

The relative path (from the base spreadsheet, typically) to the file will be the Text value that is saved in a File/Image column.

Appsheet isnโ€™t going to be able to figure out a GDrive link, because it has no way to access the GDrive file ID (or rather, it has no way to expose it to the user). To do that, youโ€™d have to use a Google App Script or similar.

If youโ€™re just needing a public URL to the file, please review the โ€œExternal URL for Image Filesโ€ section in this help doc:

I realized something similar to your idea.
After you upload file to appSheet by default appSheet save it on G-drive. You have just one option to get link to file itโ€™s use โ€œ Google Apps Scriptโ€.
Use file links more convenient if someone on back have to rename or move file between folders. App still working because access to file by link.
Let me know if you need more about it.

Thank you @VOLODYMYR_TYROL for your kind reply. Can you please breifly guide me on that. Thanks Again.

Any time, AppSheet community help me a lot. I want share it forward.
In database(G-Sheets) I created next columns:
Key, โ€œFile pathโ€, โ€œFile Nameโ€œ, โ€œFile IDโ€.

Column โ€œFile pathโ€ - itโ€™s file type in AppSheet. Originally after you uploaded file appSheet write down path to file.(exp. โ€ฆappName/folderName/fileName)

Column โ€œFile Nameโ€ itโ€™s text type in AppSheet with initial spreadsheet formula (Spreadsheet Formulas | AppSheet Help Center๐Ÿ˜ž we going to get File Name from column โ€œFile pathโ€ By SPLIT () and INDEX().
Example we have in column โ€œFile pathโ€ next data โ€œ appName/folderName/fileNameโ€. So our formula looks: =INDEX( SPLIT (column โ€œFile pathโ€, โ€œ/โ€œ) ,3).

Column โ€œFile IDโ€, will be filled with โ€œ Google Apps Scriptโ€ with custom formula. Also โ€œ Google Apps Scriptโ€ Formula have to change column โ€œFile pathโ€
to file Url.
I going to share my โ€œGoogle Apps Scriptโ€ code in couple hours

Using to read Google Drive folder as a table feature, you can get the Google Drive file Ids without scripting the codes now.

@Scott_Haaland

Then we can manipulate image/file data, relying on file IDs.

Thank you for your advice, never heard of it before.

This is just for users for those who use Google (drive) as data source. Once we save files, images or other types whatsoever, we are instantly able to get the Google Drive file IDs. Then can consume them to create download URL, create copy, get the unique URL (which is not affected by the location of file) etc.

We deploy some apps to our end users to upload mutiple files to appsheet app using this features as well.

We can do more with this read folder as table feature, althogh we have limited capabilities, such as limited availabiliies for meta data, nor not able to read sub folders etc

Can you please explain more about this part?

The most useful and reliable info source is this.

Thank You @tsuji_koichi for assistance. Can you please help me how should I integrate this in the appsheet?

With which part you need help?

Like how can I get google drive link in my excel sheet.

You mean that you would like have access to each file by link?
All files going to stay in one folder or many?

each row has a seperate folder, which contains 8 files. I want link for each file in a row in their seprate columns.

Do you want use existing files or upload new files?

Only new files.

If I understand right you want create something like for each user or employee folder and each folder have the same number of files?

Hi @sainikhushdeep ,

We donโ€™t have support for nested folders yet, so depending on how many employee folders you need, this drive folder as a table feature may not be feasible right now for you. You would essentially have to add a table for each folder as the app creatorโ€ฆwhich would be very clunky in your app beyond just a few employees.

  1. There are some posts with some suggestions to use Apps Script to fill up your sheet with the links you want. If you have a lot of employee folders, this could be the most efficient way to generate all of your file links programatically.
  2. We have plans to add subfolder support to the Drive data source, and once this is available, your existing model should work well to get the file idโ€™s for all of the files in the Employees/employee folders. I donโ€™t have a timeline for thisโ€ฆengineering is still investigating best options for implementing this and we are prioritizing with lot of other feature requests as well.
  3. If you want to use the drive data source to easily get the file ids today (and not have to use apps script), you would have to re-organize your files to put them all in a single folderโ€ฆyou could prepend all of the file names with the employee id or name for example, so that they would sort together in a drive filename viewโ€ฆbut then the drive table in your app could have immediate access to all of the file ids and you could use some virutal columns to generate your drive links or use automation to write them to another table backed by a sheet, etcโ€ฆ

R,
Scott

@Scott_Haaland
Thanks for improves appSheet.
For my client very important file management on G-drive. All files sorting by 50+ folders. I wrote logical part in โ€œFile Pathโ€œ and itโ€™s sorting good. Just one problem itโ€™s file name. I have change it in โ€œ Apps Scriptโ€. I will very appreciate if appSheet team do special field for File name or file name based on column value

Yes, each folder(user) will have same no. of files.

You try do something like That?

Employee Detail:

Employee List:
3X_1_7_17991da4bb876a23a4180e725e2e4e7723bda735.png

Why do you think, you need url on file?

@sainikhushdeep
Did you solve your question?

Yes it did @VOLODYMYR_TYROL you have been such a great help. Thank you so much!!

Top Labels in this Space