So I'm having a problem in Power Automate with an action in the SharePoint connector. The Folder Path specified by the "When a file is created" trigger does not match up with the formatting expected by the Folder path input for other SharePoint actions.
The error was Folder not found, which was odd to me because I was looking right at the folder in SharePoint.
Here's the flow:
The Folder path dynamic content comes from the trigger.
Now here is what that unaltered Folder path contains:
And here is what the Folder path input expects for a successful query:
The difference is that the correct formatting has a slash character at the beginning and no slash character at the end. The path as it comes from the trigger has no slash at the beginning and a slash character at the end.
I was able to clean the string and generate a successful request programmatically through the following methodology:
Initialize a String variable for the Folder path:
Initialize an Integer variable for the Length of the Folder path:
Generate a cleaned folder path with the substring function:
Using the cleaned string in the "Get folder metadata using path" action works and successfully finds the folder in question.
I hope this helps someone else who may encounter the same issue.
A distant "womp womp" echoes in the back of my mind
Marking this as solved.
*sad trombone noise