My question relates to SPFX Field Customizer: how to get full path of document in document library?.
How to I get the Id of the item on which the Field Customizer applies?
I have tried:
event.listItem.getValueByName("Id")
event.listItem.getValueByName("ID")
event.listItem.getValueByName(".Id")
event.listItem.getValueByName(".ID")
When Inspect the object I do not see the ID in the array:
I can however see the Id here:
Worst case, I suppose, is to get value from event.listItem["_values"] like this but it is really dirty
// This doesnt' work
let listItemId = event.listItem["_values"].find(item => item.key === "ID");
// This works
event.listItem["_values"].forEach((value: string, key: string) => {
console.log(key, value);
});
event.listItem.getValueByName('ID');
inonRenderCell
method or somewhere else?