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.
Solved! Go to Solution.
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.
Hi @akharns
First build the response flow.
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'
Next we need to build the main flow. Here we need to call the above flow using the url it generated above.
Here above Apply each will get the body of the earlier flow response.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video TutorialsUsing 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.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video TutorialsJust 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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video TutorialsI 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.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
41 | |
31 | |
29 | |
28 | |
26 |