web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need to extract the ur...
Power Automate
Unanswered

Need to extract the url from an hyperlink based text from outlook which contains multiple url based hyper link in Power automate desktop

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Team,

 

I am trying to extract the URL from an hyperlink-based text from an outlook mail that contains multiple hyperlinks texts.

can anyone help/guide me for only extracting a single url link , example below
<a href=google.com>Google</a>

<a href=yahoo.com>Yahoo</a>
<a href=bing.com>bing</a>

 

for the above example, i want to extract the URL whose text is Yahoo and its associated link in yahoo.com

 

@Expiscornovus  @grantjenkins @SudeepGhatakNZ @Sundeep_Malik @abm 
Need your guidance experts 🙂

 

I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @carlos_slim @Anonymous @Paulie78 @sayyedkohler 

  • grantjenkins Profile Picture
    11,063 Moderator on at

    I'm not sure if you want to see how to extract from the format you provided, or from hyperlinks in an email.

     

    Below is how I would extract out the hyperlinks from an email. Example of the email is below:

    grantjenkins_0-1667561899965.png

     

    The full flow is below. I'll go into each of the actions.

    grantjenkins_1-1667561944243.png

     

    I've got the trigger pointing to my inbox.

    grantjenkins_2-1667561998124.png

     

    I then use Html to text to convert the body of the email to plain text.

    grantjenkins_3-1667562053205.png

     

    This gives me the following output for the hyperlinks.

    grantjenkins_4-1667562102155.png

     

    I then use a Compose to split by new line. The expression is below:

    split(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'))

    grantjenkins_5-1667562164862.png

     

    Next, I use a Filter array to filter out lines, so we only get the hyperlinks. I've used [http to filter the items as assume we could also have https links.

    grantjenkins_6-1667562234072.png

     

    This gives us the following output.

    grantjenkins_7-1667562269651.png

     

    And finally, I use a Select to get a JSON array of links with Name and URL. The expression I use for Name and URL respectively.

    split(item(), ' [')[0]
    split(replace(item(), ']', ''), ' [')[1]

    grantjenkins_8-1667562445790.png

     

    The final output is:

    [
     {
     "Name": "Google",
     "URL": "http://google.com"
     },
     {
     "Name": "Yahoo",
     "URL": "http://yahoo.com"
     },
     {
     "Name": "Bing",
     "URL": "http://bing.com"
     }
    ]

     

    If that's not what you want, then let us know.

  • VJR Profile Picture
    7,635 on at

    Hi @Anonymous 

     

    For your reference, this is a Power Automate Desktop page and you have tagged members who are generally active on the Power Automate Cloud Flows area.

     

    Please share which area are you looking for the solution in.

    If Cloud Flows - I will move your post there.

    If Desktop - you will get answers from members here.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @VJR @grantjenkins Thanks for your reply and support. Mistakenly might have added cloud flow users as I was looking out for solutions from you experts. #thankful_To_you_Guys

    And
    I wanted this solution for the Power Automate Desktop.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    @Anonymous All good - was a fun exercise for me 🙂

     

    I haven't used Power Automate Desktop much yet, but definitely starting to look into it more. Unfortunately probably can't help with what you are after in this instance.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @grantjenkins Thank you very much for your time, I am really lucky to have you in this forum as an expert.

    Thanks alot PowerPlatform Master.

     

    Can you help me reaching people in this forum who can help me with this kind of solutions 🙂

  • VJR Profile Picture
    7,635 on at

    @Anonymous, There are multiple ways. You can use Regex too.

    But something with in-built could be as follows

     

    VJR_0-1667642705074.png

     

    VJR_1-1667642744215.png

     

    Output: 

    VJR_2-1667642766032.png

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It looks like you are using the HTML (Preview). I get the OpenAPI connection error when I use the preview. I also have the same issues as OP. Since I am automating work-related tasks, I can't use an OpenAPI connection.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard