I want to be able to pull a URL for the "containing folder" of a file I access via SharePoint using Power Automate. For instance, if I create a folder named foo and I have a document in that folder foo/foo.doc, I want the URL of the folder foo. Ideally, I'd also be able to ensure this link is shared to my organization.

2 Answers 2


I tested with Matiur's formula and it does not work quite well. Here is a new formula working in my end. You can try both of them.


For knowing if it has been shared. I think is is not doable OOTB in power automate.


After getting the properties of the file by using [Get file properties] action, you use the following expression to get the link to the folder that the file is in.

Property {Link} contains the full url of the document and replacing {FilenameWithExtension} from {Link} with empty string('') by concatenating '/' at the beginning results in the full path to the folder.

replace(outputs('Get_file_properties')?['body/{Link}'], concat('/', outputs('Get_file_properties')?['body/{FilenameWithExtension}']), '')

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.