You can use a Change Variable action inside the loop to set the value of $Variable2 to be that of $Variable1. $Variable2 will need to be declared before the loop, and remember that it will only hold the last value of $Variable1 before the loop ends. You won't have any other values that $Variable1 may have held in the loop unless you specifically append them to $Variable2 in the Change Variable action.
https://docs.mendix.com/refguide/change-variable/
I hope this helps.