Overview

In this post, we will.

  1. Add and update list items using PnPjs (spfi).
  2. Handle complex field types.
    • Text, Number
    • Choice, MultiChoice
    • Lookup, MultiLookup
    • Person, Multi-Person
    • DateTime, Yes/No
    • Hyperlink or Picture

This continues from our previous blog on reading SharePoint list data with PnPjs.

Use the SP instance

As set up in the previous blog.

import { spfi, SPFI } from "@pnp/sp";
import { SPFx } from "@pnp/sp/presets/all";
let sp: SPFI;
protected async onInit(): Promise<void> {
  await super.onInit();
  sp = spfi().using(SPFx(this.context));
}

Creating a New List Item

Updating an Existing Item

Deleting an Item

await sp.web.lists.getByTitle("Employee").items.getById(10).delete();

Pro Tips

Conclusion

You’re now fully equipped to create, update, and delete SharePoint list items in your SPFx web part using the modern PnPjs (spfi) approach. Whether you're working with simple text fields or more complex types like multi-lookup, people pickers, or choice fields, these examples provide a solid foundation for managing every SharePoint column type.

Resources

🔗 PnPjs Official Docs

Coming Up Next

In the final part of this series, we’ll build a reusable form component in SPFx that integrates PnPjs for.

Stay tuned!