How to create Nested Folders

Hi

Looking for the best way to structure folders that have sub folders. The same as you can do on your computer.

User creates Root folder (a) then user creates 2 folders in (a) (ab) and (ac). This can continue indefinitely (bd), (be) - (ef), (fg)

There is no predetermined amount of folders, sub folders and sub folders of sub folders that can be created

Final piece of this puzzle… how do we display them in a repeating group, if there is no predetermined amount.

Thanks for your help?

Datatype Folder
With a field “Parent Folder” (type Folder)

You have a group with the type Folder, with a RG inside that searching for Folders where the Parent Folder = Parent group’s Folder.

When they click a folder it sets that main group’s Folder to the new one and the cycle continues…

2 Likes

Sounds simple

So, even though I have created 1 group with 1RG… even if there are 10 levels of folders, would they all be displayed at once?

If not, is there a way to do this?

Not really displayed at once, but you can continuously click folders to go into them. Then if you need a back button just set the main group’s folder to Parent group’s Folder’s Parent Folder

Ok thanks… will give it a go

1 Like

I’m working on something similar, but can’t seem to figure out the structure.

I’d like for users to be able to upload videos to a folder, and create sub folders inside of those folders.

This is a rough structure, and they should be able to add files/folders wherever throughout the process.

Master Folder

Review Videos (Folder)
reviewvideov3.mp4 (File)
Old Review Cuts (Folder)
reviewvideov1.mp4 (File)
reviewvideov2.mp4 (File)
Final Videos (Folder)
finalvideo.mp4(File)

I have a Folder Data Type, with Parent Folder inside of it. Would I add File, File Name, Folder Name, etc. inside here as well?

I actually saw someone just put a “isFolder” yes/no field so files and folders are the same datatype, and that field differentiates the two. Kind of a good idea

Then in your RG you search for the datatype, sort by isFolder so the folders are at the top, then another sort by alphabetical. Then when they click on it you have two workflows with opposites conditions, if the isFolder is “Yes” then show the new folder, if its “no” then download the file or view it in another tab, etc.

Here’s a basic example of infinitely nested files/folders, if you had external S3 storage you would have more fields like URL, Size, etc. and you wouldn’t need the “Bubble file” field Bubble | No-code apps files-folders | Bubble Editor If you go into a certain folder you can then upload from there, or create new folders inside a folder, etc.

Thanks, Tyler! Could you make this accessible? It’s saying I don’t have permission.

1 Like

Oops, check now

1 Like

Perfect - thank you!

Do you have any recommendations for using a breadcrumb to show the file hierarchy?

I’m trying to use this thread which uses URL’s, but it’s a little tricky.

Sure check it now, I did my own version :laughing:

Try Folder 1 then go through all the nested (no name) ones, you can also click on a specific folder in the breadcrumb list to jump back. If you don’t like the URL building up and looking ugly it could probably be moved to a custom state but won’t persist after page refresh

2 Likes

Incredibly helpful - thank you!

I haven’t used “extract with Regex” Before. Very helpful!

1 Like