HTTP Request Introduction

Power Automate, previously known as MS Flow, is a cloud-based service that allows users to create automated workflows across multiple applications and services. It is one of the important pillars of the Microsoft Power Platform. It has n-number of third parties connector (in the form of APIs) available which can be leveraged to perform various actions that require lots of coding and cumbersome effort to implement. Being a low code platform, it doesn’t require any software to start development, all that’s required to start development is proper O365 license.

Power Automate comes with a very intuitive UI, where users can see the various available actions under a different sets. Once they choose any of the actions, it gets added to the flow with insightful UI, where the user can directly feed the input to get the required output.

In this article I am going to cover the most useful action “Send an HTTP request to SharePoint”. As a SharePoint developer, most of us regularly use the HTTP call in our code, as it makes code development easy. In this article, we will see the most used methods, such as GET,

Prerequisites

a. Log in to the flow portal with your Office 365 credentials.
b. For this article, I have created a SharePoint List. Please find its schema below

Http Request

For my flow, the trigger is manual, you can choose as per your business requirements.

Our focus will be on template Send an HTTP request to SharePoint and its Methods.
a. GET
b. POST
c. PATCH
d. DELETE

Let’s get started.

Click on New Step and search for the Action “Send an HTTP request to SharePoint”. Once you get the option, click on it. It will add the action to your flow.

a. Site Address: Choose your SharePoint Site from the dropdown.
b. Method: You can choose the method as per your requirement.
c. Uri: _api/web/lists/getbytitle(“List Name”), other attributes like top, filter, etc can be added here.
d. Headers: As per business requirements.
e. Body: JSON body as per business requirements.

Method Name: GET

It is one of the most common and widely used methods. If we have sufficient permission to access the data, then we can simply use GET to retrieve all the results from the endpoint.

Our GET method call is as shown below:

Now, manually trigger the flow to see the response. Grant asked permission by the flow.

With Success code: 200, it shows we have successfully executed the GET Method. Our focus area will be the response body which is in json format, so we need to use apply to each action get a result from the previous step, and then we use Compose Action to get a specific result.

Next we need copy the body of output and paste it on parse JSON

Next, we will “Apply to each” to get all the required fields.

Now, when we trigger the flow and see the result. Flow will get each item and display the User Name, User Department, and Profile Link as shown below.

Name for the first Item

Department for the First User

User Profile for the first user

Furthermore, we can process to get the profile link description and URL as per our business needs.

For any Help or Queries Contact us on info@crmonce.com or +919014146800

We have started a new online retail store    Please Visit.