Crawl through all subdirectories, append Excel file (Tree traversal)

Hi, anyone have a sample workflow for the following:

  • In the current directory, get subdirectories
  • If there are subdirectories, navigate to them one by one
  • Likewise, if there is a next level of subdirectories, navigate to these
  • If it there are no more subdirectories (i.e. leaf node), find all Excel files and append their contents to a master collated file one by one
  • Go one level up and navigate to the next subdirectory in the same level
  • Append contents of Excel files to these to the master collated file
  • Do the same for all other subdirectories
  • At the current level, find all Excel files and append them to the master collated file
  • Since all subdirectories and Excel files have been crawled, move one level up and do the same for the next folder in that level
  • Follow this pattern all the way up to the root folder

If you’re familiar with tree structure, it’s basically a depth first traversal algorithm. How do you elegantly implement this in UiPath?

Hi, DEATHFISH What’s poppin?
By any chance, Did you find the answer?
Cause, I’ve been stuck in the same problem.
I was wondering if you could help me with it.