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!!!

View solution in original post

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!!!

View solution in original post

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate 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 Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,692)