Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SLpGRgaqhs8N7Q1UGWfTjJ
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?

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

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

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

  • 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

     

     

  • Pstork1 Profile Picture
    65,997 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'.

  • 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

  • Verified answer
    Pstork1 Profile Picture
    65,997 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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard