PowerAutomate: Self-reference is not supported when updating the value of variable

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:

Expression for the above action: add(variables(‘Dummy Service Delivery Type Amount’), items(‘Apply_to_each_Service_Delivery_Type’)?[‘dxc_amount’])

Hope it helps !!

4 thoughts on “PowerAutomate: Self-reference is not supported when updating the value of variable

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.