Skip to main content

Notifications

Power Automate - Building Flows
Answered

Get File Content in Loop Issue

(0) ShareShare
ReportReport
Posted on by 3
Hi Power Platform Folks 

I am trying to set up a formula to merge documents in a folder to a PDF using OneDrive. I have finished but I run into an issue right after my Apply to loop in the first "Get File Content" action. 

Here's a brief summary of my flow:
  1. Get files (properties only): I'm fetching all files from a specific SharePoint directory:
    • Site Address: REDACTED.sharepoint.com
    • Library Name: Shared Documents
    • Folder: /General/REDACTED
  2. Initialize Variables: I've initialized three variables before entering the loop.
  3. Apply to each: I loop through each file from the list obtained in step 1.
  4. Get file content: Inside the loop, I try to get the content of each file:
    • Site Address: Same as above.
    • File Identifier: I'm using Current item from the dynamic content, which should refer to the ID of each file in the loop.

However, I'm encountering an error when the flow tries to execute the 'Get file content' action. The error message I receive is:

"Action 'Get_file_content' failed: Route did not match clientRequestId: 228b5aa1-b1f5-433a-a617-be76d74b0f06 serviceRequestId: 002778a1-203c-7000-7d72-71deb44f60cc"

I've tried the following to troubleshoot:

  • Verified that the files exist in SharePoint at the time of flow execution.
  • Checked permissions to ensure my account has access to read these files.
  • Used expressions like @{items('Apply_to_each')?['ID']} to directly reference the ID, but the error persists.
  • Ensured the Site Address is consistent across actions.
  • Re-added the 'Get file content' action to refresh dynamic content.

Despite these efforts, I'm still facing the same error. Here's a screenshot of my flow setup for reference: 

Has anyone else encountered this issue? Any suggestions on what might be causing this or how to resolve it would be greatly appreciated. I'm particularly interested in any known issues with the SharePoint connector or specific configurations that might help.

Thanks in advance for any help!

Mark

  • Verified answer
    Pstork1 Profile Picture
    Pstork1 64,741 on at
    Get File Content in Loop Issue
    Your problem is in Step#4. The Get File Content wants the File Identifier, not the Item ID.  If you check through the dynamic content you should see one listed as 'Identifier'. That is the one you want.

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

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard