I am creating an SPFX webpart and i have to call pnp/sp to check if a list item exist and if it isn't i will create a new list item. this is my code for creating a new list item:
return sp.web.lists.getByTitle(qnaListTrackingListName).items.add({
LastUpdated: d.toDateString(),
LastPublished: null,
LockedById: currentUser.Id,
LockedReleaseTime: d.toDateString()
}).then((result: ItemAddResult) => {
console.log(result);
return result.data;
});
it creates my item successfully however i want it to return the list item details including the userfield ( i need the email). currently it is only returning the id. how do i expand it to include the email address as well?
return:
GUID: "64797cb7-9c7c-408e-b848-d899440ea634"
ID: 19
Id: 19
LastPublished: null
LastUpdated: "2018-09-24T16:00:00Z"
LockedById: 10
LockedByStringId: "10"
LockedReleaseTime: "2018-09-24T16:00:00Z"
Modified: "2018-09-25T15:45:09Z"
do i need to call a get get list item with filter and expand?