0

We loaded a SP list directly from an Access query and now when we try to run a list update with pnpjs I get an "Error code: -2130575163.List data validation failed" .

There are no required fields, no validation on any columns, and no Validation settings on the list. Is this not working because it was uploaded from Access?

Updating it similar to this:

const items = await sp.web.lists.getByTitle("MyList").items.top(1).filter("Title eq 'A Title'").get();

const updatedItem = await sp.web.lists.getByTitle("MyList").items.getById(items[0].Id).update({
    my_id: mynewID,
})

Adding list items works with no issues. Updating a list item does not work.

Ryan
  • 449
  • 5
  • 21
  • Is there any update ? Did you resolve the issue in your side ? If the reply is helpful to this question, you could accept as answer so that it could help others in the forum. – Jerry Jul 17 '20 at 09:11

3 Answers3

0

Try this.


let list = sp.web.lists.getByTitle("MyList");

const i = await list.items.getById(1).update({
  Title: "My New Title",
  Description: "Here is a new description"
});

console.log(i);
spgk
  • 5
  • 4
0

Is items[0].Id valid ? Please try to use console.log (items[0].Id) to check in Developer Tool. I tested the same request in my side, my_id is a number field:

  const items = await sp.web.lists.getByTitle("JqueryList").items.top(1).filter("Title eq 'My New Title'").get();
    console.log(items);
    let list = sp.web.lists.getByTitle("JqueryList");

    const i = await list.items.getById(items[0].Id).update({
      Title: "My New Title",
      my_id: 1
    });

enter image description here

Jerry
  • 3,480
  • 1
  • 10
  • 12
0

I did resolve it - when you use the StrReverse function in Access and then upload that query to a SP list - the list type is corrupted. To fix it I simply went in and changed the type from single line text to multiline - then back to single line of text.

I was then able to update the list item.

Ryan
  • 449
  • 5
  • 21