Showing results for 
Search instead for 
Did you mean: 
Not applicable

Flow Run Error - apply for each

I had a flow working perfectly for the last couple of months until Monday it failed all three times it was triggered. The error message I receive is "InvalidTemplate. Unable to process template language expressions in action 'Packaging_email' inputs at line '1' and column '2502': 'The template language expression 'triggerBody()?['Packaging_x0020_Lead']?['Email']' cannot be evaluated because property 'Email' cannot be selected. Array elements can only be selected using an integer index. Please see for usage details.'."


When I try to change anything in the flow is changes my "If yes" outcome to apply for each. I just want it to be send an email. Any ideas why this is happening and what I can do to fix it so it will succeed?

Community Support
Community Support

Hi @Anonymous,


Could you please share more details about the Packaging Lead column in the sharepoint list?

I afraid that the Packaging Lead column is a person type column in the sharepoint list, and you have modify the Packaging Lead column to Allow Multiple Selections.


If the Packaging Lead column is a person type column in the sharepoint list, and you have modify the Packaging Lead column to Allow Multiple Selections,please refer to screenshot below to create the flow:



The expression in the Value field of the Append to Array variable as below:


The flow would run successfully as below:



Best regards,


Not applicable

Thank you for your response as I am green to Microsoft Flow!FLOW 2.png


 I tried adding that to the apply to each line and get the following error "The template validation failed: 'The repetition action(s) 'Apply_to_each_2' referenced by 'inputs' in action 'Apply_to_each' are not defined in the template.'." Am I not applying the formula in the correct spot? 

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,064)