1

how to edit properties for document in sharepoint SPFX? inside a webpart. Is it possible to do something like in the image I added?

enter image description here

  • Thank you R. Sperre. I was wondering if it was possible to get url of the document properties panel. the one we have in a document Lib. so that i can hit a button in my home page a modify a specific document properties in panel. – Raise Nov 20 '19 at 10:07
0

If you are using PnPjs this is quite easy:

let filePath = this.context.pageContext.site.serverRelativeUrl + '/Documents/Test.docx';

let updateProperties = { 
    Title: 'Updated title',
    AnotherColumn: 'Another value'
};

sp.web.getFileByServerRelativeUrl(filePath).getItem().then((listItem:Item) => {
    listItem.update(updateProperties);
});
  • Thank you R. Sperre. – Raise Nov 20 '19 at 10:01
  • I was wondering if it was possible to get url of the document properties panel. the one we have in a document Lib. so that i can hit a button in my home page a modify a specific document properties in panel. – Raise Nov 20 '19 at 10:07
  • I think the closest you can get to that is by embedding the classic EditForm.aspx in a frame and supplying the item ID : "<Library>/Forms/EditForm.aspx?ID=3&IsDlg=1" A better solution would be to build your own replica of the document panel. – Rune Sperre Nov 20 '19 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.