In Power Automate I have an Update Item action that references a field containing (potentially) multiple user accounts. Every time I put in the field's value, Power Automate helpfully embeds the Update Item action inside a loop, presumably to loop through however many email addresses/user accounts there may be in this field. That's fine.

The problem is that for some reason I can't rename the loop. Every time I do, when I go to save, I get the following message:

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'Apply_to_each' referenced by 'inputs' in action 'Update_to_Step_1' are not defined in the template.'.'.

Googling around has produced some hits on those terms but none have applied to my situation exactly, it's usually got to do with using JSON somewhere in the action, which I'm not doing. I'm simply trying to take the account from one field and copy it into another field.

How can I rename this loop but avoid the error above?

  • 1
    I think the reason you are getting this error is that the flow is identified to contain logic or configuration error. Would you care to share the flow process you are using? Also is the flow running properly if you leave the name of the action as it is? Oct 16, 2020 at 8:31
  • Hi Chelsea, I'd be happy to share more details if it will help. The flow is supposed to iterate through a series of accounts and create approvals for each in order. The piece that's bugged is very simple, just an Update Item action where I try to plug in the account from a previous step and it jumps into this loop which I can't rename. Everything works fine if I leave the name as-is.
    – thanby
    Oct 16, 2020 at 14:26

2 Answers 2


I also faced same issue for that, you just need to re write all logics under that apply to each, because when you change its name then previously defined data will not able to find 'Apply To Each' named loop. So rewrite all variable/properties after renaming loop.

  • 1
    I found the pieces of logic in the item that were causing the problem. Their data sources had the original name of the loop in them. Deleting and re-adding them corrected the issue. Thank you!
    – thanby
    Oct 26, 2020 at 13:18

So I had the same problem after copying a flow and renaming some of the components. Peeked at the code of the one that worked vs the one giving this error showed that I needed underscores in the items reference


        "table": "d6743d3a-7078-495c-a9c0-9XXXXXXX",
        "item/Title": "@items('Apply_to_each_row_in_Excel_file')?['Title']",
        "item/field_1": "@item()?['First name']",
        "item/field_2": "@item()?['Last name']",


        "table": "06c5ca71-c3ce-4067-89a9-XXXXXXX",
        "item/Title": "@items('Apply to each row in Excel File')?['Family Name']",
        "item/field_1": "@items('Apply to each row in Excel File')?['Given Names']",
        "item/field_2": "@items('Apply to each row in Excel File')?['Date of Birth']",

Added the underscores and all is now well

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.