This Microsoft flow or Power automate tutorial, we will discuss how to get SharePoint list items using Rest API in Microsoft Power Automate.
get SharePoint list items using Rest API in Microsoft Power Automate
In this example, I have created a SharePoint list as “City” where I have added an item in the Title column. Now, we see how to get all list items through REST API in Microsoft Power Automate (Flow).
In SharePoint Online custom list, when an item is created, a mail needs to be sent using the Title column in the mail. This needs to be achieved through Microsoft Power Automate (Flow).
Let’s move to Microsoft Power Automate (Flow).
Click this URL to go to Microsoft Power Automate (Flow). The following screen appears. In the Microsoft flow home page, from the left navigation, select Templates. From the main window, now, select the “Send an email when a new item is created in SharePoint” template.
After selecting the template, the following screen appears. Click the “Continue” button.
On the next screen, add a new action by clicking the + sign and expand.
In the Microsoft Flow first block, the following section appears. Add the SharePoint site address of your relative SharePoint site collection URL and select the List name in which you implemented the operation.
In the second block, the following section appears In this section, declare the variable name and set the created itemId.
The third block asks us to add the ‘Send an HTTP request to SharePoint’ action to execute REST API on current created ItemId.
Lots of people are confused about how to parse the JSON Schema data. Let us see the steps on how to get the Parse JSON Schema data.
Open the site in a browser and press F12 to open the browser console prompt. Add the following JavaScript code. This code will add a jQuery CDN in the head section of your page which will help us to call the REST API.
var element = document.createElement("script");
element.type = "text/javascript";
element.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js";
document.head.append(element);
Call the REST API and in debugger mode, assign JSON.stringify(data) to the variable. Don’t stop debugger before assigning the JSON data to declare variable (jsonvar). Copy the variable value.
$.ajax({
url: "https://pointerone.sharepoint.com/sites/SPFXDemo/_api/web/lists/GetByTitle('City')/items(1)",
method: 'GET',
headers: {
"Accept": "application/json; odata=verbose",
"content-type": "application/json; odata=verbose",
}, success: function (data){
debugger;
}});
In the fourth block, we need to add the ‘Parse JSON’ action to execute the REST body Schema.
Click the above screen pop up. Use sample payload to generate schema link. Then, the following screen pops up. Here, paste the JSON.stringify(data) in the below block. Click the “Done” button.
In the last section, we add the ‘send mail’ action. Here, let us set the To, Subject, and Body fields and save the flow.
Add an item in the City SharePoint List.
See the Microsoft Power Automate (Flow) status.
In Outlook mail, the screen appears with the currently added city name like below:
Note
Limits and configuration in Microsoft Power Automate (Flow) post
You may like Microsoft Flow or Power Automate tutorials:
- Send a Happy Birthday email to employees using Microsoft Flow in SharePoint Online
- Send text to all emergency contacts from a SharePoint list using Microsoft Flow
- Create a Leave request approval workflow using Microsoft Flow in SharePoint Online
- Share organization new employee details in Twitter using Microsoft flow
- Send an Email when Item added in a SharePoint list using Microsoft Flow
- Microsoft Flow Example: Copy files from one SharePoint Online account or folder to another
- Microsoft Flow Examples: Send a customized email when a new SharePoint list item is added
- Microsoft Flow Example Save tweets that include specific hashtag to a SharePoint list
- Microsoft flow parsing select and expand failed get manager v2
- Get daily weather reports delivered to your email and phone using Power Automate
In this tutorial, we learned how to get SharePoint list items using Rest API in Microsoft Power Automate.
I am Developer working on Microsoft Technologies for the past 6+years. I am very much passionate about programming and my core skills are SharePoint, ASP.NET & C#,Jquery,Javascript,REST. I am running this blog to share my experience & learning with the community I am an MCP, MCTS .NET & Sharepoint 2010, MCPD Sharepoint 2010, and MCSD HTML 5,Sharepoint 2013 Core
Solutions. I am currently working on Sharepoint 2010, MOSS 2007, Sharepoint 2013,Sharepoint 2013 App Dev, C#, ASP.NET, and SQL Server 2008.