numRows of dynamic Folder DAT - dependency loop

Hey guys, I tried to set up a small component to scrobble through my video clips, but I encountered a loop.

There’s two Sliders: one controlling the Select/subfolder and the other for the index of the file inside that folder. I’ve got Math CHOPs to determine the range of the Sliders so that I clamp their values to the amount of directories/videos inside the Folders.

But that results in a dependency loop, because numRows/Math range is only known after the directory has been selected. It seems to work, but I suspect it’s kinda hacky and not the way to go about things, is it? Would it pay off to set up designated Folders for each directory beforehand or so?

Another way to handle this would be a DAT execute that updates dependent values directly when the DAT Changes - rather than relying on an expression or export. This should keep you out of a feedback loop situation.

That worked, thanks a lot!

Here’s the DAT in case anyone else tries to do this: