List all files in a S3 bucket up to a certain level

Hey everyone,

So, I have a working S3 object that reads and returns all files in a bucket. I structured in a way that this bucket has 5 folders. Something like: folder1/folder2/folder3/folder3/folder4/folder5.

Now, I want to write a code that returns files up to folder4. But when I insert in the "Prefix to filter results", the contents up to folder4 (folder1/folder2/folder3/folder3/folder4), it returns also files of folder5. How can I solver that? I'm trying to write code in the "Transform results" section, but not sure if that is the right place also.

Thank you!

Hello @Vitor_Dal_Pra!

Could you share a screenshot of the S3 query with all the drop downs expanded?

Where are you inserting in "Prefix to filter results"?

That is odd that when it should limit to folder4 you are also getting 5..... Silly ask but have you tried setting the limit to folder3 to see if it still grabs all folders?

I can try to reproduce the bug with more info and see what could be the issues and how we can fix it!