SharePoint is all about document management. Therefore getting the content from a file must be something easy. Well it is that easy that there are at least 3 methods of doing this.
- Get file content action
- Get file content by path action
- Send an HTTP request to SharePoint action
In this post I’m looking at the first two options.
Both Get file content and Get file content using path actions look very similar and I would probably question why there are two actions for this.
In the above action I selected the files that I wanted to read form the little folder icons at the right.
When I typed the url for both action however, I found that I got the following error:
"message": "Route did not match\r\nclientRequestId: 1dfab1da-028e-4761-b024-e8e5460146b0\r\nserviceRequestId: 1dfab1da-028e-4761-b024-e8e5460146b0"
Well, that is not pretty!
The get file content using path did still work. Then I thought about using the Get files and use the file identifier for the file instead and this works.
This now shows the difference between the two options. When you use the get file content the url needs to have the spaces and slashes in the url encoded.However strangely enouogh this seems to only be the case when you try to use dynamic content or manually supply the file details. As we saw earlier the /Shared Documents/Document.docx worked perfectly fine when I selected the file manually. The other strange thing I noticed is that the leading slash has disappeared when when the file identifier is selected from the Dynamic content.