How to make variable update for each instance of for-each loop?
You can create the variable either at the foreach loop container or at the global scope, by making sure that the foreach container is selected when you create the variable, or nothing is selected when you create the variable.
Inside the foreach loop container you can then add an Expression Task in order to change the value of the variable at run time.
Depending on what you need exactly, you could also use a Script Task for this purpose.
There's a similar question here with the relevant details:
https://stackoverflow.com/questions/4052864/ssis-set-variable-at-runtime