Workflow to create a new folder in drive

Hi, I have a question about file management. I’m using Google Sheets and have a table called Locations and another one called Uploaded Images. The Uploaded Images table makes rows that I can upload an image to and associate it with a ref to a Location. It saves these files in my drive in a folder called Uploaded Images_Images and I made it so that their file name is the “Location they’re associated with” followed by a UniqueID(). It works okay but I’m wondering if there is a way to automatically create a folder in my drive for each Location I have and for the files to then be saved there?

0 24 3,054
24 REPLIES 24

You can do it with google apps script. I can share some code sample if you need it.

Yes please, that would be outstanding!

Why would you like to create them by yourself? Why don’t you just let the app to create those folders when new image is saved and it needs a new folder?

Whichever solution works. So far in my understanding of appsheet, I know how to reassign where an image gets saved to but I don’t understand how to have the app generate folders beyond the default way of making a folder to contain all the images uploaded to a table. I’m trying to have a folder created for basically every row in my Locations table that I would then save the images from the table Uploaded Images to.

I agree with Aleksi.

Image/File folder path, we are able to use expression.
That means we are dynamically change the path, borrowing values from the row you are currently editing to save image or even borrow the value from other table, usersetting etc.

I’m not sure AppSheet will create non-existent directories, though. This isn’t a feature I use so I can’t speak from experience.

As far as I know, it would generate the non-existing folder. Appsheet is smart enough!

Intriguing. Do you have any suggestions for an expression that would give that result to put in for the Image/file folder path?

For that table, you generate the name of folder you wish to have. and place that column name into it.

I m not testing physically with my app, but I suppose

/appsheet/data/{your app name-id}/[Column name]

should work. But I need to borrow the thought from Aleski and Steve, to see if I m on the right track!

@Aleksi
@Steve

Sure, here’s what I tried so far and it gave me this error

How about

“appsheet/data/TheFootprintProject2-1028762/”&[Station Site]

just construct the string.

Well that seemed to have done it! So now when my Uploaded Images table adds a new row I changed the image column to that file path and now it creates a folder if there wasn’t one and adds the image to one if it already existed!
Thank you!

Excellent!!!

Actually, I tried it shortened just to [Station Site] and it made the folder just in the drive where I have my spreadsheet simple as that.
So I guess it is really pretty simple. If there is no folder existing, you can just put in a column name and it will save the images in a folder named that!

Thanks for sharing your experience, I learned lesson from you for my own future case.

Anyway, great to hear you now solved issue.

This is perfect for my project, thank you!

In the past, I noticed by accident. I saved the files with name “/” within the name of the file/image under the workflow.
The appsheet split by “/”, before “/” as folder name and after “/”, as file name.

I could not locate the file on the target folder, but actually I generated the new folder without knowing that…

That s the reason I believe it would work.

FYI… if you try to use date as a key value like 01/31/2020.Image.01312020_010145 it will generate subfolders like 01 > 31 > 2020 > Images.

Just a curious question, is there a way to incorporate "/" in naming folders generated by uploading images? example folder name 001/22. 

Appreciate it.

Hi
It is not working in my case.
When i use this expression “appsheet/data/TheFootprintProject2-1028762/”&[Station Site]
in my google drive my app creat a new file not a new folder name.
What i do wrong?

how to make a multiple folder with coloumn value?
i tried “/FOTO_ANALISIS_NPK/Banyuasin”&[Kecamatan]&[Desa]&[Kode Sampel]
it goes to folder /FOTO_ANALISIS_NPK/Banyuasin

but not make the next folder /Banyuasin/Ketapang/KTP.1 . . .
instead it make one folder BanyuasinKetapangKTP.1

Helo Pak, maybe you can try this,
/FOTO_ANALISIS_NPK/Banyuasin”&"/"&[Kecamatan]&"/"&[Desa]&"/"&[Kode Sampel]
for adding a root folder u need this (/) symbol on your concate formula.

Perfect, work like magic. Thanks

obrigado, isso foi perfeito

Top Labels in this Space