To add to what Thomas and Roy already mentioned.
Variables created inside the loop are scoped (read available) to elements inside the loop. If you want to have variable updated by operations inside the loop you can simply create a variable outside (read before) of it and modify it inside of the loop.
Here is an example:
Obviously it’s just there to illustrate this particular problem, usually you would use AggregateAction to achieve it.
If you create the Boxnumber inside a loop, it will overwrite on each iteration. If you want to use the boxnumber variable for every iteration, you should place the following activity also inside the loop.
Find it with hitting the @ . @Boxnumber
here is the microflow, i need to use Boxnumber in the following activity
To add to Roy's answer: variables created inside a loop are only available inside that loop, next to the fact that they get overwritten on each iteration.