We often come across requirements in which we want to add certain value to the same variable e.g. for integer variable, x=x+5 or for string variable, test=test+”additional”.
We were trying to achieve the same thing using PowerAutomate. However, while doing this using Set Variable action, we got an error saying “Self-reference is not supported when updating the value of variable”.
Below is what we were trying to do inside Apply to each action and the expression is: add(variables(‘Service Delivery Type Total Amount’),items(‘Apply_to_each_Service_Delivery_Type’)?[‘dxc_amount’])
As this is not possible using PowerAutomate at the moment, we achieved it using another variable of same type in the middle as shown below:
And, inside Apply to each action, we added the following Set Variable actions:
Hope it helps !!