Hi Abhinay,
From the screenshot, I don't think the problem is simply "changing the same variable twice". That's a perfectly valid pattern in a microflow.
For example:
Plain Text
$Rounding = 0
Loop
Change $Rounding = $Rounding + 1
Change $Rounding = $Rounding * 10
End Loop
Mendix will execute the activities sequentially and use the latest value of the variable.
What concerns me more is this statement:
It worked for some days but then it is not working at all. After redeploying it worked again.
That sounds less like a variable issue and more like:
To troubleshoot, I'd recommend:
Plain Text
Before Change 1: {$Rounding}
After Change 1: {$Rounding}
Before Change 2: {$Rounding}
After Change 2: {$Rounding}
$Rounding is later stored in an object.In short, changing the same variable multiple times inside a loop is supported and should not randomly stop working. I'd focus on the expressions used in those activities and add logging to confirm the value after each step. That will usually reveal whether the issue is in the calculation, the loop data, or somewhere later in the microflow.