0

i am trying below to move file from source to destination but always getting GUID as undefined

if (event.selectedRows.length > 0) {
          // Check the selected rows
          event.selectedRows.forEach((row: RowAccessor, index: number) => {
            const docRelativeUrlDest :string = row.getValueByName('GUID');
            const destinationUrl = this.context.pageContext.web.serverRelativeUrl+'/Documents/'
            const docRelativeUrl  = row.getValueByName('GUID');
            sp.web.getFileById(docRelativeUrl).moveTo(destinationUrl);
          
             this.showToastr();
          });
      }

1 Answer 1

1

You should use row.getValueByName("UniqueId").

Test result: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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