0

I'm using the SharePoint List Folder action in Power Automate Desktop to list files in a SharePoint folder.
The flow started throwing an error on Monday, immediately after the weekend suggesting some sort of Microsoft update as there were no changes on my side whatsoever (permissions, folders etc)

This is the error I'm getting on the SharePoint List Folder action:

Additional info:
{
  "StatusCode": "403",
  "Message": "",
  "Body": {
    "status": 403.0,
    "message": "Attempted to perform an unauthorized operation.\r\nclientRequestId: d41e6526-3331-481d-92f5-c41660154d57,8b9803ad-3bb2-453b-8841-eaba515d02a1\r\nserviceRequestId: 79854ea1-10ed-9000-be6a-d2253bb5bf0a",
    "source": "https://Companysite.sharepoint.com/sites/Client/_api/web/GetFolderByServerRelativePath(decodedUrl=@p)?$expand=Folders,Files&@p='%2fsites%2fClient%2fShared+Documents%2fGeneral%2fTableau+Workbooks'",
    "errors": [
      "-2147024891",
      "System.UnauthorizedAccessException"
    ]
  }

I believe it has to do with some sort of encoding issue, let me explain why.
Initially I started with a dynamic variable (for the File Identifier field in the List Folder action) that had a value of /Shared Documents/General/Tableau Workbooks/ and this did not work.
I then figured out that you needed to encode this path so I changed the value to %252fShared%2bDocuments%252fGeneral%252fTableau%2bWorkbooks%252f (replacing the / and spaces with %252f and %2b respectively) which worked beautifully the whole week (2nd Sep - 6th Sep, only runs weekdays).

To troubleshoot, I just created a test flow with only the SharePoint List Folder action in it.
Instead of using dynamic variables for the Site Address and File identifier fields, I just clicked the drop down and selected the site address that was available (ie. that I have access to on SharePoint) and I did the same thing for the File Identifier field and I was able to select /Shared Documents/General/Tableau Workbooks/ for the File Identifier. I ran the flow and it worked beautifully.
The .id value of the variable produced from the Sharepoint List action was:

%252fShared%2bDocuments%252fGeneral%252fTableau%2bWorkbooks%252fClient_Operations_Dashboard_20240904.twbx.

Because the flow ran perfectly, this suggests that there are no permission issues like the error says and that the encoding of the File Identifier seems to be correct

It seems the SharePoint List Folder action (or the API it's using) may have changed how it handles or expects file paths in Power Automate Desktop
Does anyone know how to fix it?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.