Hi All,
Need some help with extracting the URL from the email body below. I have a flow which converts the received email body HTML to text and I tried to use split to extract it but its not working, can anyone advise the best way to achieve this?
This should be the accepted answer because it is by far more dynamic than the others. The regex might look ugly, but it doesn't rely on specific formatting (outside of it being a link). With an email, I guarantee, no one is going to follow any formatting rules.
Hello! I need help.
When I tried to reproduce your flow, I sometimes got this kind of error. What could be the possible causes?
I have followed followed your step by step and I am still having the same issue as the OP.
my last compose raw output is:
Updated Sept 23:
There is now a much simpler solution available to extract a URL(s) from the body of an email (or any other text value) by using the Encodian Utility - Extract URL's from Text action.
Consider this simple flow:
Which extracts all the contained URL's within the email:
You can a further flow example and instructional video on this post: Extract URLs from Text and Documents with Power Automate
Hi @Jay-Encodian,
See below raw output of the HTML to Text:
{
"statusCode": 200,
"headers": {
"Pragma": "no-cache",
"Transfer-Encoding": "chunked",
"Vary": "Accept-Encoding",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "false",
"Cache-Control": "no-store, no-cache",
"Date": "Fri, 18 Sep 2020 14:51:08 GMT",
"Set-Cookie": "ARRAffinity=7007353e6908e52d8a882a0d248752a54a5a3b25dfdde97fabc8ecca38b8d51c;Path=/;HttpOnly;Domain=conversionservice-ne.azconn-ne.p.azurewebsites.net",
"Content-Type": "text/html; charset=utf-8",
"Expires": "-1",
"Content-Length": "127"
},
"body": "https://12345.abcde.com/a3G5I000000bxkP\n\nPlease click link above to approve or reject this record. \n\nThank you!"
}
Hi @aanyoti1 ... hmmm, same data with the expressions I have already provided to you
substring(variables('Text'),lastIndexOf(variables('Text'),'https'))
substring(outputs('Html_to_text')?['body'],0,indexOf(outputs('Html_to_text')?['body'],' '))
Can you please click on the 'Raw outputs' from the Html to Text action... I think there is some extra data in the payload.
Hi @Jay-Encodian,
See below:
Hello,
Your Approval has been requested for
Products in the Basket: https://mydomain.12345.com/a3G5I000000bxkP
Please click link above to approve or reject this record.
Thank you!
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2