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 / Getting a value from a...
Power Automate
Answered

Getting a value from an outer for-each loop

(0) ShareShare
ReportReport
Posted on by 8

Hi. I am looping through a SharePoint list and each item has a 'RequestId' and can have attachments.

For each item with attachments, I loop through the attachments.

For each attachment, I want to create a file called 'RequestId_DisplayName' where 'DisplayName' is the file name, it is available, no problem.

The problem is I cannot figure out how to get the 'RequestId' from the outer loop. I have spent hours on this!!! 

Screenshot 2024-01-09 105213.png

 

Can someone please tell me what to put in the highlighted field that contains the single 'RequestId' from the outer for-each which is looping through the SharePoint list, filtering for items with attachments, then storing each attachment.

Categories:
I have the same question (0)
  • mkortink Profile Picture
    8 on at

    Replying to my own post, I have just noticed that if I delete the [Filter Array] step, that the 'RequestId' becomes available to me where I need it. So it appears [Filter Array] does more than just filter out the items in an array, it somehow changes the structure as well.

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @mkortink ,

     

    Filter array won't change array structure, but just make it not be referenced in dynamic contents directly. But since you are in Apply to each, you can write expression to reference the field:

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

     

    Best regards,

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 248 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 160 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 142 Super User 2026 Season 2

Last 30 days Overall leaderboard