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 / 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
    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

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