Hi, I am hoping someone can help me figure out why I can't save my flow. I keep getting the error 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 'Send_an_email_(V2)' are not defined in the template.'.'.
I am attaching a screenshot of the entire flow.
The goal: a single request form (uses Microsoft Forms) that sends approval requests to various people depending on the type of request submitted and the approver needed, then emails the requester letting them know if their request is approved or rejected. "Condition 2" identifies 1 of 4 options of request types - the other three all go to the same approver. If this expense type is selected, they will then select 1 of 3 approvers ("Switch").
Thank you for any help you can provide.
@tl88 its still not correct, please follow below steps:
1. Add Initialize variable at top of your flow, name it "ApproverName" and select type as string
2. Again add Initialize variable at top of your flow, name it "ApproverComments" and select type as string
3. Now after the wait for approval action, add Set variable action. Select ApproverName variable and in value select "Responses Approver Name" from dynamic content, so the Set variable action will look as follows:
4. Now again add Set Variable action below the action that you added in above step and here select ApproverComments variable and in value select "Responses Comment" from dynamic content, so the Set variable action will look as follows:
Now inside your Send Email action, use the ApproverName and ApproverComments variables instead of using Responses from Approval action.
Thank you for trying to help. Unfortunately, this does not seem to have solved the problem. I am getting the following error message:
Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Send_an_email_(V2)_5' at line '1 and column '11728' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Send_an_email_(V2)_5' to be referenced by 'repeatItems' or 'items' functions.'.'.
Flow attached.
@tl88 to get approver's name and comments you need apply to each action, please see this post on how to get approver's name https://powerusers.microsoft.com/t5/General-Power-Automate/Access-name-of-the-approver-with-out-apply-to-each/td-p/826799 and same way you can get approvers comments, then use those variables in the Send Email action.
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2