Connect Angular application to SharePoint list using MSGraph

This blog post demonstrates how to use Radzen to build an Angular application that will connect to Microsoft SharePoint using Microsoft Graph API and Azure Active Directory authentication!

Connect Angular application to SharePoint list using MSGraph

  1. Create an MSGraph application by following our instructions. Specify Sites.Read.All as Delegated permissions: ms-graph-sharepoint1.png
  2. Add an OData data source which points to the MSGraph API. Follow the second step in our documentation. Add one additional scope - Sites.Read.All: ms-graph-sharepoint2.png
  3. Save the data source and add a new empty page in Radzen. Drag and drop a DataGrid component.
  4. Click on an empty area in the page to show the Page Events in the property grid.
    • Add a new handler with Type set to Invoke Data Source Method.
    • Set name to getSitesListsItem. This method will retrieve the items from a SharePoint list which belongs to a site.
    • Add a Parameter by clicking the plus button.
    • Set Name to id. Set Value to the ID or hostname of your SharePoint Live site. You can get the ID from the MSGraph Explorer after logging in with your credentials.
    • Add another parameter. Set Name to listId. Set Value to the ID or display name of your list.
    • Add a Then handler. Set Type to Set property, Name to getListResult and Value to ${result.value}. ms-graph-sharepoint3.png
  5. Select the DataGrid component. Set the Data property to getListResult, auto-generate columns and remove unwanted: ms-graph-sharepoint4.png
  6. Run the application. It should redirect you to the Microsoft login screen. Please log with a MS business account because personal accounts don’t work with SharePoint online. After logging in you should see a DataGrid showing all list items: ms-graph-sharepoint5.png

Enjoy!

Leverage Radzen on LinkedIn

Yes, we are on LinkedIn and you should follow us!

Now, you have the opportunity to showcase your expertise by adding Radzen Blazor Studio and Radzen Blazor Components as skills to your LinkedIn profile. Present your skills to employers, collaborators, and clients.

All you have to do is go to our Products page on LinkedIn and click the + Add as skill button.

by Vladimir Enchev

Manage your OneDrive using Radzen, MSGraph and Azure AD - Part II

This blog post demonstrates how to build an Angular app that will create new, rename and delete Microsoft OneDrive items using Microsoft Graph API and Azure Active Directory authentication! To know more about how to setup your Radzen application please chec...
Read more