Thank you for choosing Microsoft Power Platform Community.
To achieve this, you can use Power Automate to create a flow that retrieves the folder details of the selected file and lists all the files within that folder.
Here's a step-by-step guide:
Trigger: Use the "When a file is created or modified (properties only)" trigger to start the flow when a file is selected in the subfolder.
Get File Metadata: Add the "Get file metadata" action to retrieve the metadata of the selected file. This will give you the folder path of the file
.
Get Folder Metadata: Use the "Get folder metadata" action to retrieve the details of the folder containing the selected file. You can use the folder path obtained from the previous step.
List Folder Contents: Add the "List folder contents" action to list all the files within the folder. You can specify the folder path obtained from the previous step.
Apply to Each: Use the "Apply to each" action to iterate through the list of files obtained in the previous step. You can perform any additional actions you need on each file.
Here's an example of how the flow might look:
Trigger: "When a file is created or modified (properties only)"
Get File Metadata: "Get file metadata" (File Identifier: File Identifier)
Get Folder Metadata: "Get folder metadata" (Folder Path: Folder Path)
List Folder Contents: "List folder contents" (Folder Path: Folder Path)
Apply to Each: "Apply to each" (Value: List Folder Contents)
This should help you retrieve the folder details of the selected file and list all the files within that folder. If you need more detailed instructions, you can refer to the Microsoft Learn documentation:
If this Post helped you, please click "Does this answer your question" and like this post to help others in the community find the answer too!
Happy to help
Robu 1