For Loop inside run function

i have this code, the data come from database and put into card using for loop, the i want commented underline function (Count(Item.id)) run and get the count value and put into count object,

how can i run a function inside for loop