1

Error message: The property 'RequesterEmpID' does not exist on type 'SP.Data.XYZListItem'. Make sure to only use property names that are defined by the type.

I edited some of the list column names in SharePoint. after which I get this error. 'RequesterEmpID' is one of the list column which was renamed.

Code:

  export function addDatatoSharepoint(props){ 
  return dispatch => {
    props.Web.lists.getByTitle('Listname').items.add({
      RequesterName: props.FirstName + " " + props.LastName,
      RequesterJobTitle: props.Title, 
      RequesterEmpID: props.EmpID, 
      RequesterDepartment: props.Department, 
      RequestDate: new Date().getDate(),
      DocumentID: props.DocumentID,  
    }).then(r => {
        console.log(r);
    });
  }
}

enter image description here

3
  • What is the type of RequesterEmpID column?
    – Amos
    Commented Oct 13, 2020 at 8:24
  • Hi @Amos_MSFT, thank you for the quick response. The type of RequesterEmpID column is Single line of text.
    – Priya
    Commented Oct 13, 2020 at 9:17
  • 1
    As Ganesh saied,you need to check the internal name of RequesterEmpID column.
    – Amos
    Commented Oct 13, 2020 at 9:33

1 Answer 1

1

While adding item to SharePoint list, we need to use the internal name of the column.

Check the internal name of your RequesterEmpID column using below link and use it in your code:

Find the internal name of SharePoint column

1
  • Exactly the internal name is different. Thank you!!.
    – Priya
    Commented Oct 13, 2020 at 9:40

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.