Aug 20 2021 06:58 AM
Aug 20 2021 06:58 AM
I have 1000s files. I also have several metadata to be assigned to each file.
I want to upload those files into my SharePoint document library.
I am planning to create and cvs/excel file and add all files name and assigned them with metadata.
Then I want to upload all files into the document library and assign those metadata automatically via PowerShell.
But I do not know how to do it.
I hope some of you may know the solution.
Looking forward to hearing from you.
Aug 20 2021 09:31 AMSolution
Aug 22 2021 09:17 AM - edited Aug 22 2021 09:20 AM
Hi @Juan Carlos González Martín, It does not work in this way.
We have M-Files application. This application stores all files and then categorize them by metadata.
When I export the files from the M-Files, it gives me two files. 1-An excel that shows all metadata. 2-Folder that shows all Files/documents.
To upload all documents in a SharePoint document library is easy.
But then I have to g into the document library and create each metadata that is in the excel files and then go through 10.0000 files and assign them to each metadata based on the excel file.
However, I think there must be a solution such as:
1-Create SharePoint document library (I can do it manually)
2-Create all metadata that is in excel sheet(which I got it when I export files from the M-Files application) (I can do it manually )
3-Uplaod all files.(I can do it manually or PowerShell)
So far so good. I need a help from here on...
4-I need a PowerShell script that can upload my excel sheet(from my computer) which has all metadata to the SharePoint document library (created at step-1) and can map/assign those metadata to the relevant files that I upload at step 3.
Hope that is clear.
Aug 22 2021 10:06 AM
Aug 23 2021 01:20 AM
I tried that with exactly the same excel sheet and the same columns. It gives me the following error:
Get-PnPListItem : No list found with id, title or url 'Bulk'
At line:10 char:14
+ ... ListItems = Get-PnPListItem -List $ListName -PageSize 2000 -Fields "F ...
+ CategoryInfo : WriteError: (:) [Get-PnPListItem], PSArgumentException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Lists.GetListItem