I wanted to create a list of folders, but I don’t understand why it’s failing.
Imagine this simple arrange of folders. I want a list of only the folders below “Guiones”.
So, the list should be:
Saga
Saga 2
This is the code I use:
I don’t fully understand it myself, and I got this result:
First problem I have: for some reason, “Guiones” is also part of the list. I want it gone.
Second problem: it seems that it only took 2 folders no matter what I do. I tried some irrelevant shenanigans that ended in the names changing to a folder route (“Escritos/Guiones/Saga”), but the result is the same nonetheless.
But I messed around with the code. In “filter path”, I changed “current folder” to the actual folder, so it ignores the first subfolder. .filter(path => path.startsWith("Escritos/Guiones") && path !== ("Escritos/Guiones"))
I couldn’t cut the overall path, so, in the “root length” I added all the subfolders characters (from +1 to +9). So, this was the end code: