use for each ui element and iterate over rows get the values of column for each row and then click on detail of corresponding row…for getting column values from row selector use find children and get the required child to get value and then click
alternately use regex in your selector to find only rows which are greater than 0 baically somr regex like this would help ^[+]?\d+([.]\d+)?$
so your selector looks somethign like this,you need to add idx as well which will server as incrementer so till idx fails you can run loop
<webctrl tag='TD' tablecol='Amount column number' innertext='^[+]?\d+([.]\d+)?$' matching:innertext='regex' idx='counter starting from 1 and increment till no more rows' />
<nav up='1'>
<webctrl tag='TD' tabelcol='Detail button column number' />
Instead giving only index try to modify your selectors by using UiExplorer.
And its better to for each UiElement activity instead of for each row in data table. So that you can easily click respective element based on your condition.
I think you can use Find Children to get all rows, loop through them, extract the “Amount” from each row element, and click the “Detail” button if the amount > 0. This avoids relying on fragile indexes.
Also, add delays or check element existence before clicking to ensure the button is ready.
If helpful, mark as solution. Happy automation with UiPath