Hi,
I have a flow which is trying to pull hierarchical data into an excel file via a loop but part of it isn't working.
The basic structure is:
- Take the top tree item and output this into an excel table with a column called 'Processed' set to 0
- Initialize a variable called Parent and set the value of Parent to be the id for the top tree item
- Start a Do Until loop
- Get all direct child elements from the Parent and output them into the excel table with the 'Processed' column set to 0
- Set the 'Processed' column for the top tree item as 1
- List rows present in a table with a filter for 'Processed eq 0' and 'Top Count of 1'
- Set the Parent variable to be the id from the List rows action above so that the loop continues with the next unprocessed record
- Loop until there are no 'Processed' columns set to 0
No matter what I seem to do, the List rows action in step 3.3 always returns the top tree item ignoring the update from step 3.2
I have tried doing this all in one flow, I have added loops to check until the 'Processed' column has definitely been updated (using the excel a Get a Row action), I have set this up as a solution with the List Rows in a child flow. If I cancel the flow and then re-run it, it will move onto the next record but then get stuck on that one so I know the filter etc. is all correct. And if I open the excel file I can see the record does update when expected but the List rows action is completely ignoring this.
It feels like the Do Until runs the excel list rows action once at creation and then never re-evaluates it but I can't find anything documenting this. Any ideas how I can fix / work around this?