Formula to recall the name of the folder of a note

Hello everyone, I’m trying to use a formula (inside a base) to recall the name of the folder that contains the note, but I couldn’t find the proper documentation in the wiki to help me. Example:

Path: Subjects/Math/Basic Math/Numbers and Sets.md

I tried to use “link(file)” but it returns the whole path of the note.

Thanks in advance.

“file.folder” also returns the whole path and I need just the latest folder.

How about this formula?

file.folder.split("/")[-1]

Thank you! Do you know where I can learn more about these “command.something.something” combinations?

On the Introduction to Bases page, check out the links to “Bases syntax” and “Functions”. Examples of using those are at the link to “Formulas”.