Hi, @Menno Diesveld ,
If you want to use Flow to upload files, you will need to use File System actions. This connector needs to have On-Premise Data Gateway configured before. As I am not an expert on Power Automate, you can have a test about it and post in Power Automate Forum for more information.
Here are some tutorials on configuring Data Gateway:
accessing-your-on-prem-data-using-on-prem-data-gateway
use-local-file-system-with-microsoft-flow-fa6a2caaa1c3
And you can take using PowerShell as an option. With Pnp module, we can easily use Add-PnpFile
to upload files to SharePoint library with required metadata value.
Here is my demo:
#Skip this line if you have installed PNP module
Install-Module SharePointPnPPowerShellOnline
Connect-PNPOnline -URL <siteURL>
Add-PNPFile -Path "<FilePath>" -folder "Shared Documents" -values @{Title="FolderName"}
This simple script uses file path to upload the file to Documents, setting the title to be FolderName.
And according to your description, you need to use the folder name as the metadata. So how is the folder name located in the path? Does it has a fixed location or with any other rules? And how many fields will need to be handled?
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.