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 Platform Community / Forums / Power Automate / Stepping through an se...
Power Automate
Unanswered

Stepping through an self build array

(0) ShareShare
ReportReport
Posted on by 280

Hi All,

I have 2 share-point lists. I need to analyse the items in both. so I do two "get items" and then a union expression to combine the two into a single array.

Now I'm going to step through this array using the "apply to each" action... I select the array as the source. When I test I see that it makes the correct amount of passes to go through the array...

 

No I want to set actions within the "apply to each", but when I want to use info from my array I only see the array-name, I can't select any of the "fields" within. I think I need something with compose... but I'm real novice with stepping through an array...

 

any basic education on how to step through an array and for example set an variable based on a array element would be really appreciated!

 

Regards

charles

 

Categories:
I have the same question (0)
  • RobElliott Profile Picture
    10,416 Super User 2026 Season 1 on at

    @Charles-v-D, one thing you can do is up at the top of your flow to initialize a string variable:

    0-initStringVariable.png

    Next, after the Union add an apply to each. Use the output of the Compose with the union in it, select your string variable then in the value field select Current item from the dynamic content:

    1-Append.png

    The outpu of the union will look something like mine here:

    2-resultUnion.png

    But once each item has gone into the string variable the result of that will look like this (with the first 2 items shown):

    3-resultStringVariable.png

    You can then do whatever actions are needed on each one.

    I hope that helps you get closer to what you need.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

     

  • Charles-v-D Profile Picture
    280 on at

    Thanks @RobElliott , but in your example how would I get hold of Rey, Chorley etc.. so a specific field in each of the CurrentItems?

     

    regards

    Charles

     

  • RobElliott Profile Picture
    10,416 Super User 2026 Season 1 on at

    My reply shows you that. Each item in the union is put into a separate string variable. For further actions below that in your flow you would select the string variable and it would use the value for that item (remember it's inside an apply to each). You don't select the actual value of the item unless for example you want to use a condition, you select the variable and it puts in the appropriate value.

    Rob
    Los Gallardos

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Charles-v-D 

     

    Based on the explanation you provided, the union will create an array of objects and you will have to access individual items using the key for that specific value. For example: 

     

     

    ddw.PNG

    Here, I have an array with name and place and in the loop i am iterating over each array item to get the name from that particular item. 

    Expression: 

    items('Apply_to_each')?['Name']

    This gets the name key from the current item in the array. Similarly you can use the SP column names to get those values. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard