Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var id = await pnp.sp.web.lists.getByTitle("Site Pages").items.filter("FileLeafRef+eq+\'" + pageName + "\'").select("Id").get();
console.log("Calling update Page properties called for - " + id[0].Id);
if(id.length > 0)
{
await pnp.sp.web.lists.getByTitle("Site Pages").items.getById(id[0].Id).update({
Field1: value1 != "" ? value1 : null,
Field2: value2 != "" ? value2 : null,
PeopleField1: peopleValID != "" ? peopleValID : null,
PeopleMultiUserField1: multiusers.length > 0 ? {
results: multiusers
} : {results : null},
Title : title
}).then((iar: ItemUpdateResult) => {
console.log(iar);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment