Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Gartner® Magic Quadrant™: 15 YEARS A LEADER - GET THE REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
p0cket0m
Contributor III
Contributor III

How to use recursion in QAA?

We use the List files block to access files on our SharepointOnline site

p0cket0m_0-1730983570491.png


How can we achieve recursion to navigate into subfolders without knowing the depth of folder hierarchy?

p0cket0m_2-1730983925648.png

At the end, we want a list of all leafs (files), no matter how many subfolders exist and how deep hierarchy goes.

We want to avoid using a nested blocks scenario like this

p0cket0m_3-1730984090346.png

Any ideas would be highly appreciated 👍 

 

Labels (3)
4 Replies
p0cket0m
Contributor III
Contributor III
Author

I tried this

p0cket0m_1-1731057155129.png

But the process doesn't fork and it iterates only over the first branch of the tree.

gopipnr
Contributor II
Contributor II

Instead of using a single loop, break each process into specific labeled steps, allowing you to navigate between them using conditions that iterate through each step.

gopipnr_0-1731059292502.png

 

p0cket0m
Contributor III
Contributor III
Author

Unfortunately this doesn't seem to work with the List files on Sharepoint block. It stops after the first branch only reading folder 1 and file 2,3 but it doesn't proceed to folder 2. The program doesn't continue after the Go To Label block.

p0cket0m_1-1731084350406.png

p0cket0m_0-1731084284974.png

 

p0cket0m
Contributor III
Contributor III
Author

Figured out why, you cannot add blocks after a Go To Label block. They don't connect. Only the blue path is possible. After breaking the loop, it cannot reach the Output block below Go To Label 3 block (red path).

p0cket0m_0-1731090965926.png