Getting elements text from hierarchy list

Hello guys. So i’ve ran into a problem again. I need to scrape a websites hierarchy list. The list looks like this:


Ive written down the numbers of the text that is parent, and their subcategories. Bassically, I need To extract all of the list with all their decendants. Sometimes, there are more than 3 branches of the list, basically meaning that the categorie number 3 can have it branch out to 4 and etc.

Im seeking for help, because I cant seem to figure out how to construct the workflow. I understand, that I need to use Find children and get attribute activities, but how to achieve the whole working workflow, is a question for me. Can anyone please give me ideas to what to use?

Ideal output would look like this:

1 category —> 2 category —> 3 category and so on
1 category ----> 2 category ----> 3 category and so on

@Povilas_Jonikas

Basically you need to create recursion till you reach the final level

Use toplevels in find children to get only one level down…do this in loop till you reach zero count of returned values

Cheers

1 Like

But how is this achievable? How to stop the loop, when there are no other descending levels? Thanks for the answer :slight_smile:

@Povilas_Jonikas

yes when the count is zero the loop stops

cheers