Ui Automation for Check box dynamically

Hello Community,
I want to checked all check-boxes in the web page, for some transactions it would be come one, two, three, four, so on.
So how I do this automate dynamically by bot.
All check box came into first column.

Select the first element in element exists and change the selectors in UiExplorer till you get an idx tag in selectors. Once you get an idx tag, use a while loop incrementing the idx everytime and checking if the element still exists. break loop if element doesnot exist.