web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Hi! Building a flow to...
Power Automate
Answered

Hi! Building a flow to send emails using excel

(0) ShareShare
ReportReport
Posted on by 23

Every time I try to run my flow I get the following error message: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@variables('varEmailAddresses')' is of type 'String'. The result must be a valid array.  

 

Please may someone help me solve this issue?Capture2608.PNGCapture26082.PNG

Categories:
I have the same question (0)
  • StretchFredrik Profile Picture
    3,395 Super User 2025 Season 2 on at

    Hello,

     

    It is complaining because your variable is a string of email adresses, and it cant loop that, it needs to loop an array, try making the string into an array with the follwing:

     

    split(stringvariable, ';')
  • khanya Profile Picture
    23 on at

    Thank you so much for your response! Do you know where/how I can make that change?Capture26083.PNG

  • Verified answer
    v-yujincui-msft Profile Picture
    on at

    Hi @khanya ,

     

    I agree with what @StretchFredrik said, you could use the Split() function to return an array from a string containing multiple email addresses. 

    I'm not sure how you set your string variable, so I have made a simple test for your reference. 

    split(variables('varEmailAddresses'),';') 
    items('Apply_to_each') 

    vyujincuimsft_2-1661845355280.png

    Result Screenshot: 

    vyujincuimsft_3-1661845415047.png

     

     

    Best Regards, 
    Charlie Choi 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard