Get all Data from the screen on condition

Please refer the snap shot for better understanding.

I need to fetch the ID which is starting from R

1st condition is I have to check if “Review| Review Candidate is available”

If yes then fetch the ID (Starting from R)

2nd is I have to if below is “Review|Review Candidate” (which is in purple)
if that is available then Fetch that ID too.

The number of Review|Review Candidate can be any .

Any logic or suggestions would be appreciated

I would like at the parent / child relationship in terms of selectors.

Firstly, you can use the ‘Check App State’ / ‘Element Exists’ on the “Review| Review Candidate”
If True - retrieve the ID (again look at the selectors / potentially use anchor?)

Same for the second “REVIEW - Review Candidate”.

Thanks for the Idea.

Do I need to use the loop for this sequence ?
Because the number of Finding the 2nd Condition ins unknown

Can you look at the selector for the 2nd condition? i.e. aaname or innertext = “REVIEW - Review Candidate” etc?