Author Details

avatar-teacher

Evolvous

We are a team of tech enthusiast and this section is where we love to share our experience and our knowledge. We try our best to help you understand technical topics by giving you live instances of how-to’s, guides, tips, FAQ’s and troubleshoots.

If you like it or have questions, do share your feedback in the comments section below.

Power Automate HTTP Request and Response

Let us say you want to configure a Power Automate HTTP request service, do some tasks, and then return a response. So how can we build this?  The answer is to create an HTTP Request Trigger. It can be used to receive a Power Automate HTTP request, process it, and return a response to the target application or parent flow.  

Click here to get Microsoft Power Platform Services

Scenario to see the HTTP Request and Response

Scenario: 1

My scenario is to filter the master SharePoint list, extract some records based on the filter and then generate a PDF from the filtered records and save it as an attachment in a different SharePoint List.  

Step – 1:  

  • Create a new Instance Cloud Flow,
  • Enter your flow name and search for the “Request” trigger
  • Choose the Trigger “When an HTTP Request is Received.” 

After these steps are selected, you have to provide the “Request Body JSON Schema.” To generate the schema, automatically use the “Use sample payload to generate schema.” Then inside the Textbox, provide the JSON format as given below. 

For this example, I am using the below sample. 

    “FileId”: “%252fSOW%2bTemplate%252ftest”, 

    “ListItemID”: 1, 

You don’t need to worry about schema as it will generate automatically as per your sample payload. It looks like the below image: 

Power Automate HTTP Request and Response request received - Evolvous

 

Next, perform your required operation, like fetching some details or records from SharePoint List. 

In the end, when you have done with your needed functionality, add Response action. 

In my flow, I have taken Response action as shown in the below image which, returns the item ID to which the newly generated PDF is attached. I required this ID in another flow, so I am returning this value, but you can return any value. 

Let’s discuss your project

Power Automate HTTP Response & Request - Evolvous

When you save the flow, you will see the Unique HTTP POST URL generated for the flow, which will be used whenever you request this flow. 

Power Automate http request received body - Evolvous

Step – 2: Call this flow from another flow. 

Search for the “HTTP” action and add it to your current flow. We need the HTTP POST URL of the newly created flow in Step – 1, so copy that and paste in URI of the HTTP action. 

Select “POST” in the method dropdown. 

Enter below in Headers: 

 “Content-Type”: “application/json” 

In the Body, enter values in JSON format as per the schema we have used in the flow created in step 1. 

 “FileId”: @{outputs(‘Create_file’)?[‘body/Id’]}, 

 “ListItemID”: @{outputs(‘Create_item’)?[‘body/ID’]} 

}  

Click here to see

So finally, my HTTP action looks like this: 

HTTP return value - Evolvous

To receive the response from the HTTP action, there is a “Response” action.  

For example, I am storing the response in compose action to use further in my flow. For this, enter the below script:  

@outputs(‘HTTP’).body.Message  

Here, ‘HTTP’ is the name of the HTTP action.  

Body - Evolvous

As I returned the ID value from Power Automate HTTP flow, I got the id in Compose result. 

I hope you found this blog beneficial. 

Let’s discuss your project

________

Written by Priyanka Patel

Priyanka is Senior Software Developer at Evolvous Limited – specialists in Microsoft Technologies.