Skip to content

Instantly share code, notes, and snippets.

@AsishP
Last active March 11, 2018 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AsishP/87e92332ec63ce29252d0f4d17e38bed to your computer and use it in GitHub Desktop.
Save AsishP/87e92332ec63ce29252d0f4d17e38bed to your computer and use it in GitHub Desktop.
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