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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Suggested Answer

Array - Apply to each

(0) ShareShare
ReportReport
Posted on by 203
Hi All!

I'm having a really frustrating time with Power Automate arrays and Apply to each, and could do with some sanity! I have a simple task. I want to take a section of text, split it into an array using a delimiter and then loop through the array to check each element.

So far, I've initialised the variable as and array, stored my sample text into a Compose action, set my array value using split to generate my array elements. The next step uses "Apply to Each" to loop through each element. This is where I am having problems - Power Automate always skips this and stops. I tried to simplify the steps by manually creating an array but still get the same issue:



 


It's driving me bonkers! If someone could point out the obvious, I would be eternally grateful!!!
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    Is the Set Variable in the screenshot the way you are creating the array?  That's not the way you describe it in the text, but I think that is the problem. I don't think the flow is recognizing your array as an array.  That's why the apply to each is being skipped.  Try actually using Split() and a string to initialize the array.
     
    split('Test1, Test2, Test3', ',')

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
     
  • Mattpst Profile Picture
    203 on at
    Hi @Pstork1,

    I was using the "manual" approach to creating the array for testing - trying to keep it simple and followed this article to troubleshoot:

    https://digitalmill.net/2023/07/12/using-loops-and-accessing-array-elements-in-power-automate/#:~:text=In%20Power%20Automate%2C%20loops%20provide,through%20all%20the%20array%20elements.

    I used the split function previously and get the same error.
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    I just tried it using Split and it works for me.  Looking at your screenshots you are using a Set Variable action.  Did you use the Initialize Variable earlier in the flow?  That is requried.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Mattpst Profile Picture
    203 on at
    Hi @Pstork1,

    Yep, I have an initialise:

     
    I've tried us the Do...Until action and get the same problem.
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    Then you don't need the Set Variable in your screenshot.  As I said the flow I posted, which should look like yours, works fine.  If you are doing exactly the same I'm not sure why it doesn't work for you.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
     
  • Mattpst Profile Picture
    203 on at
    Yes, I know that I don't need the Set when I am initialising the variable with the same data - as I said, this was just for testing whilst I was playing around trying to work out why something as simple like an Apply to each wasn't working.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard