Linked lists in repeating group

Hi all; I’ve been using bubble for a few days now, and I’m effectively making a clone of google drive, but in a split up way. I couldn’t figure out how to make a repeating group of different types (folders, images, files) where content would usually go. So I split it up.

Now I’ve set up folders as a separate breadcrumb trail at the top of the page. Now my theory is if I can pass in the current folder as a custom state from the page- I could make a repeating group that shows the parent of the last thing in the cell.
So
Folder A has Parent Folder B
Folder C has Parent Folder A
So if I pass in a current folder as Folder C, here
Creating a trail
Folder B / Folder A /Folder C (current folder)

I just can’t figure out how to get a repeating group to horizontally refer to the parents parents parent until there are no more parent folders.
Any ideas?