Updating metadata of files using the REST API with Python or Node

%3CLINGO-SUB%20id%3D%22lingo-sub-429186%22%20slang%3D%22en-US%22%3EUpdating%20metadata%20of%20files%20using%20the%20REST%20API%20with%20Python%20or%20Node%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-429186%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20uploaded%206000%2B%20documents%20in%20sharepoint.%20I%20would%20like%20to%20update%20the%20metadata%20of%20each%20file%20(like%20publish%20date%2C%20author%2C%20etc).%20For%20each%20document%20I%20have%20a%20corresponding%20XML-file%20locally%20on%20my%20computer%20with%20the%20metadata%20and%20I%20would%20like%20to%20go%20through%20each%20file%20and%20update%20the%20corresponding%20metadata%20in%20Sharepoint%20using%20either%20Python%20or%20Javascript.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20used%20spsave%20to%20upload%20files%20before%2C%20but%20I%20don't%20really%20see%20a%20simple%20way%20to%20find%20the%20file%20by%20name%20and%20update%20the%20metadata.%20I've%20also%20looked%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsp-add-ins%2Fupload-a-file-by-using-the-rest-api-and-jquery%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsp-add-ins%2Fupload-a-file-by-using-the-rest-api-and-jquery%3C%2FA%3E%26nbsp%3Bbut%20I%20can't%20see%20how%20to%20connect%20to%20Sharepoint%20running%20this%20code%20in%20my%20Node%20script.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20experience%20in%20this%20or%20hints%20where%20I%20should%20look%20for%20an%20answer%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBr%2C%3C%2FP%3E%3CP%3EMarcus%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi,

 

I have uploaded 6000+ documents in sharepoint. I would like to update the metadata of each file (like publish date, author, etc). For each document I have a corresponding XML-file locally on my computer with the metadata and I would like to go through each file and update the corresponding metadata in Sharepoint using either Python or Javascript.

 

I have used spsave to upload files before, but I don't really see a simple way to find the file by name and update the metadata. I've also looked at https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/upload-a-file-by-using-the-rest-api-and-j... but I can't see how to connect to Sharepoint running this code in my Node script. 

 

Does anyone have experience in this or hints where I should look for an answer?

 

Br,

Marcus

 

0 Replies