Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Practical SharePoint Framework (SPFx) Development
  • Table Of Contents Toc
  • Feedback & Rating feedback
Practical SharePoint Framework (SPFx) Development

Practical SharePoint Framework (SPFx) Development

By : Franck Cornu, Anoop T.
close
close
Practical SharePoint Framework (SPFx) Development

Practical SharePoint Framework (SPFx) Development

By: Franck Cornu, Anoop T.

Overview of this book

The SharePoint Framework (SPFx) has revolutionized how developers create custom solutions for Microsoft 365. Whether you're building Web Parts, extensions, or full-fledged applications, mastering SPFx is essential for delivering modern and scalable SharePoint solutions. Authored by experienced SPFx developers, this book serves as a comprehensive guide to developing with SPFx, offering practical examples, structured guidance, and best practices. You’ll start by understanding the Microsoft SharePoint and Microsoft 365 ecosystem before exploring hands-on development with SPFx. You’ll learn how to create Web Parts, work with the property pane, connect to APIs, deploy solutions, and implement different types of extensions. Additionally, the book covers debugging, testing, and upgrading solutions efficiently. By the end of this book, you’ll be able to confidently build, deploy, and manage SharePoint solutions using SPFx while leveraging community tools and libraries to enhance development efficiency.
Table of Contents (29 chapters)
close
close
Lock Free Chapter
1
Part 1: Getting Started with the SharePoint Framework
6
Part 2: Building Web Parts with the SharePoint Framework
11
Part 3: Building Extensions with the SharePoint Framework
19
Part 4: Going Further with the SharePoint Framework

Using the SharePoint REST API

To demonstrate how to use the SharePoint REST API, we will now update the getProducts() method of the ProductCatalogService class to use the SPHttpClient client to fetch the list of products from a SharePoint list instead of the Microsoft Graph API.

First, we update the constructor of the class to take an SPHttpClient parameter and the absolute web URL from where the products list is located:

export class ProductCatalogService implements IProductCatalogService {
  private _spHttpClient: SPHttpClient;
  private _webUrl: string;
  constructor(spHttpClient: SPHttpClient, webUrl: string) {
    this._spHttpClient = spHttpClient;
    this._webUrl = webUrl;
  }
  ...

Unlike the Microsoft Graph API, all HTTP requests with the SharePoint REST API are made relative to the site where the data is located. We use the /_api/web/lists/GetByTitle('Products')/items...

Subscribe to access the full title

Advance your knowledge in tech

A Packt subscription gives you instant online access to our library of over 8,000 practical eBooks and videos, constantly updated with the latest in tech
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon