web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
Power Automate - Building Flows
Answered

Get File Content (Sharepoint)

Like (0) ShareShare
ReportReport
Posted on 22 Dec 2021 18:53:25 by 10

I'm new to Power Automate (slowly getting the hang of it) and I am having an issue with the "Get File Content" action. My starting trigger is "When a file is created in a folder(Sharepoint)" with the action "Get File Content" followed by "Get file Metadata". 

 

The issue I'm having is when I try to insert the "file id" dynamic content in both "Get File Content" and "Get file Metadata", there is no option only "x-ms-file-id" which I've tried testing but does not work. 

 

What is the difference between "File id" and "x-ms-file-id" and why can I not get the former even after the trigger?

I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    68,214 Most Valuable Professional on 22 Dec 2021 at 19:02:09
    Re: Get File Content (Sharepoint)

    I just ran a test and "x-ms-file-id" should work.  That is the file identifier for this particular trigger.  As you can see from the screenshots below it does work

    image.png

    image.png

  • milk4chocolate Profile Picture
    4 on 13 Jan 2022 at 05:36:19
    Re: Get File Content (Sharepoint)

    Hi Pstork1,

    Your screenshots are great.  I have a new question regarding Get File Content. I am trying to send this file as attachment in the email as below.  I can see the attachment in the email but the PDF file is always blank.  Please help.

     
     

    TT.jpg

     

    Best regards,

    Christina

  • Pstork1 Profile Picture
    68,214 Most Valuable Professional on 13 Jan 2022 at 13:06:50
    Re: Get File Content (Sharepoint)

    The ContentBytes property should be 'File Content' from the Get File Content, not 'Body'.

  • PANube Profile Picture
    8 on 07 Apr 2022 at 06:02:44
    Re: Get File Content (Sharepoint)

    Hi Pstork1,
    I would agree, but MS seams to update the File Content after saving and reopening the FLOW. So you end up withe the body, although you chose the File Content.

    Before saving the Flow:

    PANube_1-1649311316751.png

    After saving an reopening the FLOW:

    PANube_2-1649311357893.png

     

     

  • PANube Profile Picture
    8 on 07 Apr 2022 at 06:11:46
    Re: Get File Content (Sharepoint)

    And it seems, that Body behaves different than File Content. At least I get problems when I try to pass on the File Content.

  • Community Power Platform Member Profile Picture
    on 25 Mar 2023 at 14:56:35
    Re: Get File Content (Sharepoint)

    If this is inside of an apply to each function then your dynamic content may be misrepresenting the location. You can try using expressions instead to ensure you're grabbing the file content from the current pass on the apply to each rather than the get file content connector. It should look something like this: items('Apply_to_each')?['File_content']

     

    Let me know if this helped, and consider giving it a thumbs up to help other users find this answer in the future.

  • Community Power Platform Member Profile Picture
    on 23 Aug 2023 at 16:05:26
    Re: Get File Content (Sharepoint)

    How can you direct a file based on a particular string in its name?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 707 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 499 Moderator

#3
chiaraalina Profile Picture

chiaraalina 312

Last 30 days Overall leaderboard
Loading complete