SlideShare une entreprise Scribd logo
1  sur  14
Webinar Series: Getting Started with SharePoint Framework
Getting Started with
SharePoint Framework
Webinar Series
Webinar Series: Getting Started with SharePoint Framework
Loading SharePoint Data
in a SPFx web part
Webinar Series: Getting Started with SharePoint Framework
Jenkins NS
Modern Workplace Solution Architect | Consultant
Founder & Director @
Microsoft Teams, Power Platform and SPFx Specialist
International Speaker | Blogger | Trainer
SPS Bangalore Organizer
aOS Ambassador
@jenkinsns
https://www.facebook.com/msteamsinfo
in/jenkinsns
jenkinsns@gmail.com
http://www.jenkinsblogs.com
jenkinsns
https://www.facebook.com/spfxinfo/
Webinar Series: Getting Started with SharePoint Framework
Agenda
Page Context
Web Services Overview
SharePoint REST API’s
Using HttpClient
Loading SharePoint data
Demo
- Using No JavaScript Framework
- Using React
Webinar Series: Getting Started with SharePoint Framework
Page Context
• The page context provides standard definitions for common SharePoint objects that need to be shared between the client-side
application, web parts, and other components. Typically the data is fetched via REST queries when navigating to a new page, but it can
also be preloaded by the web server or filled from a custom application cache.
 Provides access to information about current context
 Greatly extended version of _spPageContextinfo
Property Description
aadInfo If the current page doesn't have an associated Azure Active Directory tenant, this property will be undefined
cultureInfo It provides culture info for the current user of the application
isInitialized Returns whether the PageContext has been initialized
list Contextual information for the SharePoint list that is hosting the page. If there is no list associated to the current page, this property
will be undefined
listItem Contextual information for the SharePoint list item that is hosting the page. If there is no list item associated to the current page, this
property will be undefined
site Contextual information for the SharePoint site collection ("SPSite") that is hosting the page.
user It provides contextual information for the SharePoint user that is accessing the page. This class is primarily used with the
PageContext class.
web Contextual information for the SharePoint site ("SPWeb") that is hosting the page.
Webinar Series: Getting Started with SharePoint Framework
Page Context …
Examples
import { SPPermission } from '@microsoft/sp-page-context’;
 this.context.pageContext.web.absoluteUrl
 this.context.pageContext.web.permissions.hasAllPermissions(SPPermission.fullMask);
 hasAllPermissions : Checks if the user has all the permissions
 this.context.pageContext.web.permissions.hasAnyPermissions(SPPermission.manageWeb);
 hasAnyPermissions: Checks if the user has any permission from the collection of permissions
 this.context.pageContext.web.permissions.hasPermission(SPPermission.viewPages);
 has Permission: Checks if the user has given permission
Webinar Series: Getting Started with SharePoint Framework
Web Services Overview
Scenario: Customer is having existing web service which is developed into
ASP.NET. Currently, we need to develop SPFx web part for SharePoint
application. We want to fetch some information using this web service and
need to populate into this webpart.
How is authentication handled in the ASP.NET web service?
Answer: By using the AadHttpClient, you can easily connect to APIs secured
by using Azure AD without having to implement the OAuth flow yourself
 Developers building client-side solutions are responsible for implementing
authorization by using the OAuth implicit flow in their application. In
SharePoint Framework solutions, that's already done as part of the
framework through MSGraphClient and AadHttpClient, both of which are
introduced in SharePoint Framework v1.4.1.
 Note : If you build solutions on a version of the SharePoint Framework
earlier than v1.4.1, you can still connect to resources secured with Azure
AD. In this case, you need to implement the OAuth implicit flow by using
ADAL JS.
Webinar Series: Getting Started with SharePoint Framework
SharePoint REST API’s
 SharePoint includes a Representational State Transfer (REST) service that is comparable to the
existing SharePoint client object models. Developers can interact remotely with SharePoint data
by using any technology that supports REST web requests. This means that developers can
perform Create, Read, Update, and Delete (CRUD) operations from their SharePoint Add-ins,
solutions, and client applications, using REST web technologies and standard Open Data
Protocol (OData) syntax.
 To access SharePoint resources using REST, construct a RESTful HTTP request by using the
OData standard, which corresponds to the desired client object model API.
 https://{site_url}/_api/web
 https://{site_url}/_api/site
 Example
 https://jpower4dev.sharepoint.com/_api/web/lists/GetByTitle('Contactlist')/Items
URL end Points – Some exaples Description
web/title Retrieves the title of a list
Lists Retrieves all lists on a site
lists/getbytitle('listname') Retrieves a single list's metadata
lists/getbytitle('listname')/items Retrieves items within a list
lists/getbytitle('listname')?select=Title Retrieves a specific property of a document
Webinar Series: Getting Started with SharePoint Framework
Using HttpClient
 HttpClient implements a basic set of features for performing REST operations against a generic service.
 import { HttpClient, IHttpClientOptions, HttpClientResponse } from '@microsoft/sp-http’
 If you already used the HttpClient and SPHttpClient in your SharePoint Framework projects, you might have noticed that you have two types of request methods options:
GET and POST. These two types of requests are the most used ones, but what if you want to use other HTTP methods like PUT, PATCH, DELETE?
 If you need to make calls with other HTTP methods, you can make use of the fetch which is available on both the HttpClient and SPHttpClient classes. The fetch method
allows you to specify the HTTP method type per request yourself. Fetch is also used behind the scenes when you are using the GET and POST methods.
1. how you can make use of the fetch method and specifying the request method to perform: spHttpClient
this.props.context.spHttpClient.fetch(restUrl, SPHttpClient.configurations.v1, {
method: "PATCH",
body: JSON.stringify({
"Something": "Some content to patch" })
}).then((response: SPHttpClientResponse) => { // Do your thing});
2. with the HttpClient, but you will notice that is not that different to use:
this.props.context.httpClient.fetch(restUrl, HttpClient.configurations.v1,
{ method: "DELETE"})
.then((response: HttpClientResponse) => { // Do your thing
});zax
Webinar Series: Getting Started with SharePoint Framework
Loading SharePoint data
 SharePoint Framework is the new development model and it is a page and Web part model which provides full support for client-side SharePoint development,
easy integration with SharePoint data, and support for open-source tooling.
Standard “features” of SPFx
 ToolchainAuthenticationSP
 GraphAPI and WebAPI Access
 CDN hosting
 Config experience
 Solution hosting
 Component is able to get the right application context
 Tenant-wide Deployment
Webinar Series: Getting Started with SharePoint Framework
Demo
https://github.com/jenkinsns/spfx-demo-webparts
Download the code
Webinar Series: Getting Started with SharePoint Framework
References…
 http://jenkinsblogs.com/2016/08/24/create-a-sharepoint-framework-client-webpart-retrive-list-items/
 https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part
 https://www.youtube.com/channel/UC4JieFHDrN0elIYtZDktZSg
 https://www.youtube.com/channel/UC_mKdhw-V6CeCM7gTo_Iy7w
Webinar Series: Getting Started with SharePoint Framework
Thank You
Webinar Series: Getting Started with SharePoint Framework
Next up…
SPFx with React
Siddharth Vaghasia

Contenu connexe

Tendances

SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewRob Windsor
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficientlypostmanclient
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APISparkhound Inc.
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web servicesnbuddharaju
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기lanslote
 
An introduction to consuming remote APIs with Drupal 7
An introduction to consuming remote APIs with Drupal 7An introduction to consuming remote APIs with Drupal 7
An introduction to consuming remote APIs with Drupal 7Josh Kopel
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentRob Windsor
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Rob Windsor
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding RESTNitin Pande
 
Progressive EPiServer Development
Progressive EPiServer DevelopmentProgressive EPiServer Development
Progressive EPiServer Developmentjoelabrahamsson
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sitesjoelabrahamsson
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
The Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIThe Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIEyal Vardi
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debateRestlet
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIQUONTRASOLUTIONS
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIChris Beckett
 

Tendances (20)

SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST API
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
 
An introduction to consuming remote APIs with Drupal 7
An introduction to consuming remote APIs with Drupal 7An introduction to consuming remote APIs with Drupal 7
An introduction to consuming remote APIs with Drupal 7
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
CakePHP REST Plugin
CakePHP REST PluginCakePHP REST Plugin
CakePHP REST Plugin
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
Progressive EPiServer Development
Progressive EPiServer DevelopmentProgressive EPiServer Development
Progressive EPiServer Development
 
EPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & TricksEPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & Tricks
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sites
 
Implementation advantages of rest
Implementation advantages of restImplementation advantages of rest
Implementation advantages of rest
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
The Full Power of ASP.NET Web API
The Full Power of ASP.NET Web APIThe Full Power of ASP.NET Web API
The Full Power of ASP.NET Web API
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST API
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST API
 

Similaire à SPFx Webinar Loading SharePoint data in a SPFx Webpart

Asynchronous reading and writing http r equest
Asynchronous reading and writing http r equestAsynchronous reading and writing http r equest
Asynchronous reading and writing http r equestPragyanshis Patnaik
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsLiam Cleary [MVP]
 
Stefaan Ponnet, Fusebox
Stefaan Ponnet, FuseboxStefaan Ponnet, Fusebox
Stefaan Ponnet, Fuseboxnascomgenk
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...WebStackAcademy
 
RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHPAndru Weir
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Mario Cardinal
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365Luis Valencia
 
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint FrameworkharePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint FrameworkJenkins NS
 
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Mohan Arumugam
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIRob Windsor
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use itnspyre_net
 
SharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and EventsSharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and EventsMohan Arumugam
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Charlin Agramonte
 
Services in Drupal 8
Services in Drupal 8Services in Drupal 8
Services in Drupal 8Andrei Jechiu
 

Similaire à SPFx Webinar Loading SharePoint data in a SPFx Webpart (20)

WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
Restful services with ColdFusion
Restful services with ColdFusionRestful services with ColdFusion
Restful services with ColdFusion
 
Asynchronous reading and writing http r equest
Asynchronous reading and writing http r equestAsynchronous reading and writing http r equest
Asynchronous reading and writing http r equest
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
 
Stefaan Ponnet, Fusebox
Stefaan Ponnet, FuseboxStefaan Ponnet, Fusebox
Stefaan Ponnet, Fusebox
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 
RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHP
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 
REST API Basics
REST API BasicsREST API Basics
REST API Basics
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
 
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint FrameworkharePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
 
Restful API's with ColdFusion
Restful API's with ColdFusionRestful API's with ColdFusion
Restful API's with ColdFusion
 
Web api
Web apiWeb api
Web api
 
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST API
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use it
 
SharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and EventsSharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and Events
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
 
Services in Drupal 8
Services in Drupal 8Services in Drupal 8
Services in Drupal 8
 

Plus de Jenkins NS

All about Send proactive messages in Microsoft Teams BOT
All about Send proactive messages in Microsoft Teams BOTAll about Send proactive messages in Microsoft Teams BOT
All about Send proactive messages in Microsoft Teams BOTJenkins NS
 
Surfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-in
Surfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-inSurfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-in
Surfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-inJenkins NS
 
Global M365 Developer Bootcamp 2020 Hyderabad: KEYNOTE
Global M365 Developer Bootcamp 2020 Hyderabad: KEYNOTEGlobal M365 Developer Bootcamp 2020 Hyderabad: KEYNOTE
Global M365 Developer Bootcamp 2020 Hyderabad: KEYNOTEJenkins NS
 
Global M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTE
Global M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTEGlobal M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTE
Global M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTEJenkins NS
 
SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...
SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...
SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...Jenkins NS
 
Extend the unextended in microsoft teams
Extend the unextended in microsoft teamsExtend the unextended in microsoft teams
Extend the unextended in microsoft teamsJenkins NS
 
Power Automate integration with SPFX webpart
Power Automate integration with SPFX webpartPower Automate integration with SPFX webpart
Power Automate integration with SPFX webpartJenkins NS
 
Task-oriented interactions in Microsoft Teams with messaging extensions
Task-oriented interactions in Microsoft Teams with messaging extensionsTask-oriented interactions in Microsoft Teams with messaging extensions
Task-oriented interactions in Microsoft Teams with messaging extensionsJenkins NS
 
Microsoft power platform
Microsoft power platformMicrosoft power platform
Microsoft power platformJenkins NS
 
Introduction to microsoft teams app templates
Introduction to microsoft teams app templatesIntroduction to microsoft teams app templates
Introduction to microsoft teams app templatesJenkins NS
 
Build an app from scratch using teams app studio for ms teams
Build an app from scratch using teams app studio for ms teamsBuild an app from scratch using teams app studio for ms teams
Build an app from scratch using teams app studio for ms teamsJenkins NS
 
Empowering citizen developers using power apps
Empowering citizen developers using power appsEmpowering citizen developers using power apps
Empowering citizen developers using power appsJenkins NS
 
Ms teams webinar-getting started with microsoft teams development
Ms teams webinar-getting started with microsoft teams developmentMs teams webinar-getting started with microsoft teams development
Ms teams webinar-getting started with microsoft teams developmentJenkins NS
 
M365 virtual marathon build your first power virtual agents bot
M365 virtual marathon   build your first power virtual agents botM365 virtual marathon   build your first power virtual agents bot
M365 virtual marathon build your first power virtual agents botJenkins NS
 
SPSChennai2020
SPSChennai2020SPSChennai2020
SPSChennai2020Jenkins NS
 
Trivandrumtechcon20
Trivandrumtechcon20Trivandrumtechcon20
Trivandrumtechcon20Jenkins NS
 
Governance and administration for teams app development
Governance and administration for teams app developmentGovernance and administration for teams app development
Governance and administration for teams app developmentJenkins NS
 
Getting started with spfx
Getting started with spfxGetting started with spfx
Getting started with spfxJenkins NS
 
Architecting your Intranet with SharePoint Modernization
Architecting your Intranet with SharePoint ModernizationArchitecting your Intranet with SharePoint Modernization
Architecting your Intranet with SharePoint ModernizationJenkins NS
 
Bots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teamsBots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teamsJenkins NS
 

Plus de Jenkins NS (20)

All about Send proactive messages in Microsoft Teams BOT
All about Send proactive messages in Microsoft Teams BOTAll about Send proactive messages in Microsoft Teams BOT
All about Send proactive messages in Microsoft Teams BOT
 
Surfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-in
Surfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-inSurfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-in
Surfacing SPFx Solutions in SharePoint, MS Teams, and Outlook Add-in
 
Global M365 Developer Bootcamp 2020 Hyderabad: KEYNOTE
Global M365 Developer Bootcamp 2020 Hyderabad: KEYNOTEGlobal M365 Developer Bootcamp 2020 Hyderabad: KEYNOTE
Global M365 Developer Bootcamp 2020 Hyderabad: KEYNOTE
 
Global M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTE
Global M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTEGlobal M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTE
Global M365 Developer Bootcamp 2020 Hyderabad: WELCOME NOTE
 
SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...
SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...
SPFx Outlook add-in with Azure Cognitive services to detect the sentiment bef...
 
Extend the unextended in microsoft teams
Extend the unextended in microsoft teamsExtend the unextended in microsoft teams
Extend the unextended in microsoft teams
 
Power Automate integration with SPFX webpart
Power Automate integration with SPFX webpartPower Automate integration with SPFX webpart
Power Automate integration with SPFX webpart
 
Task-oriented interactions in Microsoft Teams with messaging extensions
Task-oriented interactions in Microsoft Teams with messaging extensionsTask-oriented interactions in Microsoft Teams with messaging extensions
Task-oriented interactions in Microsoft Teams with messaging extensions
 
Microsoft power platform
Microsoft power platformMicrosoft power platform
Microsoft power platform
 
Introduction to microsoft teams app templates
Introduction to microsoft teams app templatesIntroduction to microsoft teams app templates
Introduction to microsoft teams app templates
 
Build an app from scratch using teams app studio for ms teams
Build an app from scratch using teams app studio for ms teamsBuild an app from scratch using teams app studio for ms teams
Build an app from scratch using teams app studio for ms teams
 
Empowering citizen developers using power apps
Empowering citizen developers using power appsEmpowering citizen developers using power apps
Empowering citizen developers using power apps
 
Ms teams webinar-getting started with microsoft teams development
Ms teams webinar-getting started with microsoft teams developmentMs teams webinar-getting started with microsoft teams development
Ms teams webinar-getting started with microsoft teams development
 
M365 virtual marathon build your first power virtual agents bot
M365 virtual marathon   build your first power virtual agents botM365 virtual marathon   build your first power virtual agents bot
M365 virtual marathon build your first power virtual agents bot
 
SPSChennai2020
SPSChennai2020SPSChennai2020
SPSChennai2020
 
Trivandrumtechcon20
Trivandrumtechcon20Trivandrumtechcon20
Trivandrumtechcon20
 
Governance and administration for teams app development
Governance and administration for teams app developmentGovernance and administration for teams app development
Governance and administration for teams app development
 
Getting started with spfx
Getting started with spfxGetting started with spfx
Getting started with spfx
 
Architecting your Intranet with SharePoint Modernization
Architecting your Intranet with SharePoint ModernizationArchitecting your Intranet with SharePoint Modernization
Architecting your Intranet with SharePoint Modernization
 
Bots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teamsBots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teams
 

Dernier

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Dernier (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

SPFx Webinar Loading SharePoint data in a SPFx Webpart

  • 1. Webinar Series: Getting Started with SharePoint Framework Getting Started with SharePoint Framework Webinar Series
  • 2. Webinar Series: Getting Started with SharePoint Framework Loading SharePoint Data in a SPFx web part
  • 3. Webinar Series: Getting Started with SharePoint Framework Jenkins NS Modern Workplace Solution Architect | Consultant Founder & Director @ Microsoft Teams, Power Platform and SPFx Specialist International Speaker | Blogger | Trainer SPS Bangalore Organizer aOS Ambassador @jenkinsns https://www.facebook.com/msteamsinfo in/jenkinsns jenkinsns@gmail.com http://www.jenkinsblogs.com jenkinsns https://www.facebook.com/spfxinfo/
  • 4. Webinar Series: Getting Started with SharePoint Framework Agenda Page Context Web Services Overview SharePoint REST API’s Using HttpClient Loading SharePoint data Demo - Using No JavaScript Framework - Using React
  • 5. Webinar Series: Getting Started with SharePoint Framework Page Context • The page context provides standard definitions for common SharePoint objects that need to be shared between the client-side application, web parts, and other components. Typically the data is fetched via REST queries when navigating to a new page, but it can also be preloaded by the web server or filled from a custom application cache.  Provides access to information about current context  Greatly extended version of _spPageContextinfo Property Description aadInfo If the current page doesn't have an associated Azure Active Directory tenant, this property will be undefined cultureInfo It provides culture info for the current user of the application isInitialized Returns whether the PageContext has been initialized list Contextual information for the SharePoint list that is hosting the page. If there is no list associated to the current page, this property will be undefined listItem Contextual information for the SharePoint list item that is hosting the page. If there is no list item associated to the current page, this property will be undefined site Contextual information for the SharePoint site collection ("SPSite") that is hosting the page. user It provides contextual information for the SharePoint user that is accessing the page. This class is primarily used with the PageContext class. web Contextual information for the SharePoint site ("SPWeb") that is hosting the page.
  • 6. Webinar Series: Getting Started with SharePoint Framework Page Context … Examples import { SPPermission } from '@microsoft/sp-page-context’;  this.context.pageContext.web.absoluteUrl  this.context.pageContext.web.permissions.hasAllPermissions(SPPermission.fullMask);  hasAllPermissions : Checks if the user has all the permissions  this.context.pageContext.web.permissions.hasAnyPermissions(SPPermission.manageWeb);  hasAnyPermissions: Checks if the user has any permission from the collection of permissions  this.context.pageContext.web.permissions.hasPermission(SPPermission.viewPages);  has Permission: Checks if the user has given permission
  • 7. Webinar Series: Getting Started with SharePoint Framework Web Services Overview Scenario: Customer is having existing web service which is developed into ASP.NET. Currently, we need to develop SPFx web part for SharePoint application. We want to fetch some information using this web service and need to populate into this webpart. How is authentication handled in the ASP.NET web service? Answer: By using the AadHttpClient, you can easily connect to APIs secured by using Azure AD without having to implement the OAuth flow yourself  Developers building client-side solutions are responsible for implementing authorization by using the OAuth implicit flow in their application. In SharePoint Framework solutions, that's already done as part of the framework through MSGraphClient and AadHttpClient, both of which are introduced in SharePoint Framework v1.4.1.  Note : If you build solutions on a version of the SharePoint Framework earlier than v1.4.1, you can still connect to resources secured with Azure AD. In this case, you need to implement the OAuth implicit flow by using ADAL JS.
  • 8. Webinar Series: Getting Started with SharePoint Framework SharePoint REST API’s  SharePoint includes a Representational State Transfer (REST) service that is comparable to the existing SharePoint client object models. Developers can interact remotely with SharePoint data by using any technology that supports REST web requests. This means that developers can perform Create, Read, Update, and Delete (CRUD) operations from their SharePoint Add-ins, solutions, and client applications, using REST web technologies and standard Open Data Protocol (OData) syntax.  To access SharePoint resources using REST, construct a RESTful HTTP request by using the OData standard, which corresponds to the desired client object model API.  https://{site_url}/_api/web  https://{site_url}/_api/site  Example  https://jpower4dev.sharepoint.com/_api/web/lists/GetByTitle('Contactlist')/Items URL end Points – Some exaples Description web/title Retrieves the title of a list Lists Retrieves all lists on a site lists/getbytitle('listname') Retrieves a single list's metadata lists/getbytitle('listname')/items Retrieves items within a list lists/getbytitle('listname')?select=Title Retrieves a specific property of a document
  • 9. Webinar Series: Getting Started with SharePoint Framework Using HttpClient  HttpClient implements a basic set of features for performing REST operations against a generic service.  import { HttpClient, IHttpClientOptions, HttpClientResponse } from '@microsoft/sp-http’  If you already used the HttpClient and SPHttpClient in your SharePoint Framework projects, you might have noticed that you have two types of request methods options: GET and POST. These two types of requests are the most used ones, but what if you want to use other HTTP methods like PUT, PATCH, DELETE?  If you need to make calls with other HTTP methods, you can make use of the fetch which is available on both the HttpClient and SPHttpClient classes. The fetch method allows you to specify the HTTP method type per request yourself. Fetch is also used behind the scenes when you are using the GET and POST methods. 1. how you can make use of the fetch method and specifying the request method to perform: spHttpClient this.props.context.spHttpClient.fetch(restUrl, SPHttpClient.configurations.v1, { method: "PATCH", body: JSON.stringify({ "Something": "Some content to patch" }) }).then((response: SPHttpClientResponse) => { // Do your thing}); 2. with the HttpClient, but you will notice that is not that different to use: this.props.context.httpClient.fetch(restUrl, HttpClient.configurations.v1, { method: "DELETE"}) .then((response: HttpClientResponse) => { // Do your thing });zax
  • 10. Webinar Series: Getting Started with SharePoint Framework Loading SharePoint data  SharePoint Framework is the new development model and it is a page and Web part model which provides full support for client-side SharePoint development, easy integration with SharePoint data, and support for open-source tooling. Standard “features” of SPFx  ToolchainAuthenticationSP  GraphAPI and WebAPI Access  CDN hosting  Config experience  Solution hosting  Component is able to get the right application context  Tenant-wide Deployment
  • 11. Webinar Series: Getting Started with SharePoint Framework Demo https://github.com/jenkinsns/spfx-demo-webparts Download the code
  • 12. Webinar Series: Getting Started with SharePoint Framework References…  http://jenkinsblogs.com/2016/08/24/create-a-sharepoint-framework-client-webpart-retrive-list-items/  https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part  https://www.youtube.com/channel/UC4JieFHDrN0elIYtZDktZSg  https://www.youtube.com/channel/UC_mKdhw-V6CeCM7gTo_Iy7w
  • 13. Webinar Series: Getting Started with SharePoint Framework Thank You
  • 14. Webinar Series: Getting Started with SharePoint Framework Next up… SPFx with React Siddharth Vaghasia

Notes de l'éditeur

  1. https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aadhttpclient