cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
taras
Level: Powered On

Getting multi-line plain text into Flow using "Request" POST

I'd like to POST a block of text from an HTML <textarea> to a "When a HTTP request is received" component.

 

I've tried just doing it as an HTML form (putting the Flow request URL as the <form> action), but I appreciate this is not the right way to do it.

 

My question is how can I get a multi-paragraph block of plain text from my HTML/PHP webpage into Flow?

1 ACCEPTED SOLUTION

Accepted Solutions
taras
Level: Powered On

Re: Getting multi-line plain text into Flow using "Request" POST

Thanks, that was a helpful start.  It is now working.

 

So to get my multiline comment into Flow using HTTP POST:

 

In PHP I did this:

	$url = "https://prod-74.westeurope.logic.azure.com/__url_copied_from_Flow__";
	
	$ch = curl_init();
	
		// Set the url, number of POST vars, POST data
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
		curl_setopt($ch,CURLOPT_URL, $url);
		curl_setopt($ch,CURLOPT_POST, 1);
		curl_setopt($ch,CURLOPT_POSTFIELDS, "My multiline comment\n Is here");
	
		// Execute post
		$result = curl_exec($ch);
	
	// Close connection
	curl_close($ch);

 

And on the Flow side I did:

comment.png

 

Then loaded the comment into a variable using:

 

comment2.png

 

This isn't a perfect or even best practice way of doing things but it works!!!

2 REPLIES 2
Community Support Team
Community Support Team

Re: Getting multi-line plain text into Flow using "Request" POST

Hi @taras ,

 

It seems that you would like to work with the HTTP trigger “When a HTTP request is received”.

 

Here is a blog on using Microsoft Flow to send email from HTTP request could be a reference:

https://medium.com/@zaab_it/microsoft-flow-send-email-from-http-request-f6577ad46b2c

Hope it would be helpful.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
taras
Level: Powered On

Re: Getting multi-line plain text into Flow using "Request" POST

Thanks, that was a helpful start.  It is now working.

 

So to get my multiline comment into Flow using HTTP POST:

 

In PHP I did this:

	$url = "https://prod-74.westeurope.logic.azure.com/__url_copied_from_Flow__";
	
	$ch = curl_init();
	
		// Set the url, number of POST vars, POST data
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
		curl_setopt($ch,CURLOPT_URL, $url);
		curl_setopt($ch,CURLOPT_POST, 1);
		curl_setopt($ch,CURLOPT_POSTFIELDS, "My multiline comment\n Is here");
	
		// Execute post
		$result = curl_exec($ch);
	
	// Close connection
	curl_close($ch);

 

And on the Flow side I did:

comment.png

 

Then loaded the comment into a variable using:

 

comment2.png

 

This isn't a perfect or even best practice way of doing things but it works!!!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 201 members 4,741 guests
Please welcome our newest community members: