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?
How can you direct a file based on a particular string in its name?
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.
And it seems, that Body behaves different than File Content. At least I get problems when I try to pass on the File Content.
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:
After saving an reopening the FLOW:
The ContentBytes property should be 'File Content' from the Get File Content, not 'Body'.
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.
Best regards,
Christina
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
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional