Tuesday, October 31, 2017

Read SharePoint list Items using REST API and ReactJS

Read SharePoint list Items using REST API and ReactJS

Step1: Create a "ReactDemo" list and list columns as shown below.

Step2: Create an HTML page and saved as "react.html" and upload into Site Assets library in SharePoint. Copy the "react.html" file full url from for future reference. Update below in "react.html" file.

<!DOCTYPE html>
  <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script>
  <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
  <div id="container"></div> 
  <script type="text/babel">
    var destination = document.querySelector("#container");
    class LinksClass extends React.Component {
        constructor() {
            this.state = {
                Links: [
                        "Link_x0020_Title": "",
                        "Title": ""
        componentDidMount() {
        RetrieveLinksData() {
            var reactHandler = this;
            var objHeaders = {
                type: "GET",
                headers: {
                    "accept": "application/json;odata=verbose"
                mode: 'cors',
                cache: 'default',
                credentials: 'include'
                objHeaders).then(function (response) {
                return response.json()
            .then(function (json) {
                var results = json.d.results;
                reactHandler.setState({Links: results});    
            .catch(function (ex) {
                console.log('parsing failed', ex)
        render() {
            return (
                            .map(function (item, key) {
                                return (
                                    <li key={key}>
                                        <a href={item.Link_x0020_Title.Url}>

Step3: Create a webpart page and add content editor webpart in to the page. update content link url with "react.html" page url.

Step4: final result.


  1. Nice Blog!
    I've gone through all the the blog regarding Sharepoint with react to design and develop the great app and I believe that this is the best blog one can learn with. I was looking to hire reactjs development company in India and got your blog.
    Thanks for such a great article.

    1. Great Article Cloud Computing Projects

      Networking Projects

      Final Year Projects for CSE

      JavaScript Training in Chennai

      JavaScript Training in Chennai

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. Good one to begin। With SharePoint and reactjs You may please add other crud operationd in it।

  3. Can you let me know how we can get people or group field value

  4. The article is so appealing. You should read this article before choosing the Big data cloud solutions you want to learn.


Featured Post

Protect an API by using OAuth 2.0 with Azure Active Directory and API Management

Protect an API by using OAuth 2.0 with Azure Active Directory and API Management https://docs.microsoft.com/en-us/azure/api-management/api-...

Popular posts