cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

HTTP request and reply

I am trying to set up a "hello world" example of passing a request to an HTTP flow and getting a response.  I have solved a few pieces, like passing the data from flow A to flow B, but I have not yet figured out how to return a value.

 

Here's the example:

1. Flow A sends a value called "query" with a value of "What is your name?"

2. Flow B sees the incoming question, and sends a response called "Answer" with a value of "Donald Duck".

 

I am able to pass the request string in Flow A via a HTTP POST, and I'm able to see the value in Flow B.  How can I configure the two flows so Flow B can send the response and Flow A can see it?  I have found that I can use a Response card in Flow B to specify the return value but I don't know how to configure Flow A.

 

This sounds really elementary, but I haven't been able to find the answer yet with Google.  Your help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

I fixed it.  It's working now.  I used variables on both sides, which let me have complete control of the data types.  Also, I think I was using the wrong return value or in the wrong place.  

 

Btw, "Do Until" with a flag to cause it to iterate once works great for getting the return value from the HTTP call.

 

 

View solution in original post

6 REPLIES 6
Super User III
Super User III

Hi  @akharns 

 

First build the response flow.

 

Flow1.png

 

Above I have only one paramter to pass as string. So construct that JSON.

 

Next step is the response. Here I have hardcoded a value 'HelloWorld'

 

Flow2.png

 

Next we need to build the main flow. Here we need to call the above flow using the url it generated above. 

 

Flow3.png

 

Here above Apply each will get the body of the earlier flow response. 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

Using your examples,

 

1. In the Response Flow   I understand that the Request Body in "When a HTTP request is received" defines the data that is passed INTO the Response Flow, the "FolderPath" element.  Then, the Response in the same flow has a value of "HelloWorld", meaning that it has only one return value, without a name.  Can I return a record?  How would I declare it?

 

2. In the Main (calling) Flow   The Body in HTTP sends the input value, which here is called "Name" to the Response flow.  I assume this would need to have the same name as in the JSON in the body of the Response Flow.  Then you're using "Apply to each", which is a looping mechanism.  I'm not getting multiple responses, so I don't understand that.  Maybe I would use that only if I was returning a collecion?  If not, how do I see the return value(s)?  

 

 

Hi @akharns 

 

1. Yes you can return a record but format as JSON and output.
2. Because the results are in JSON it always going to add a 'Apply to each' loop. This is by design behaviour.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

Just now getting back to this.  

"Apply to each" says it requires an array.  If I'm going with your "Hello World" example, it's a string.  What am I missing?

Hi @akharns 

 

Could you please post your response "Hello World" run history result?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

I fixed it.  It's working now.  I used variables on both sides, which let me have complete control of the data types.  Also, I think I was using the wrong return value or in the wrong place.  

 

Btw, "Do Until" with a flag to cause it to iterate once works great for getting the return value from the HTTP call.

 

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (7,219)