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 / Apply to each variable...
Power Automate
Unanswered

Apply to each variable is only capturing one input

(0) ShareShare
ReportReport
Posted on by 20

I'm trying to create a variable that stores multiple SharePoint IDs.  The workflow is all based on attachments.  If there is more than one attachment in an email, the workflow will create a SharePoint item with a new ID for each attachment and then send/wait for an approval.  The flow is not returning any errors, but it is only updating the first SharePoint item when I have multiple approvals because the variable is only capturing the first SharePoint ID to come through from the approvals.  I need it to update the next SharePoint item as well.  Thoughts?

 

Screen Shot 2022-02-27 at 7.20.46 PM.png

Screen Shot 2022-02-27 at 7.22.48 PM.png

Screen Shot 2022-02-27 at 7.40.24 PM.png

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @LMT ,

     

    The point is you are using "Set variable" in the first Apply to each which means you will only get the last ID because subsequent IDs always override previous IDs. To achieve your need, you actually need to initialize an array variable and in the first "Apply to each" use "Append to array variable" to get the array of all the IDs.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • LMT Profile Picture
    20 on at

    Thanks, makes sense!

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 425 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard