Assuming we have the following file path:
![](https://i0.wp.com/mspowerautomate.com/wp-content/uploads/2021/12/word-image-185.png?w=1200&ssl=1)
In order to get the root directory or subfolder, use the “Get file part path” action. Click the {x} button and select FilePath. After running the flow, you can see in the variable pane that this allows you to obtain the FileName, File Extension, as well as the RootPath.
![](https://i0.wp.com/mspowerautomate.com/wp-content/uploads/2021/12/word-image-186.png?w=1200&ssl=1)
![](https://i0.wp.com/mspowerautomate.com/wp-content/uploads/2021/12/word-image-187.png?w=1200&ssl=1)