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 / Extract href from email
Power Automate
Answered

Extract href from email

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi ,

I am struggeling to filter the href URL from the emailbody to send only this information to slack.

The trigger is if I receive a certain email than please get only the href URL and use only that variable and send it to slack

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    ibenetos_2-1665736089638.png

     

  • Sundeep_Malik Profile Picture
    6,501 on at

    @Anonymous 

    Can you share an example of data you are receiving in the email body and what output you require?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Sundeep_Malik 
    this is the output if I convert the email to HTML

    Here the PM 2022-10-05 throws 500 errors
    [https://kb.confluence.com/display/tech/thissite]
    


    and behind the 2022-10-05 throws 500 errors is the link behind in the brackets

    I want the description and the href behind as value

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Any news? @Sundeep_Malik 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Expiscornovus maybe you could help 🙂 

  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @Anonymous,

     

    You could use an expression which splits on the '[https://' part of the body/body of your email.

     

    Below is an example.

    This setup only works for the first link it finds.

     

    I have also included an indexOf to make sure there is actually such a link in the email.

     

     

    if(equals(indexOf(triggerOutputs()?['body/body'], '[https://'), -1), 'Link not Found', concat('https://',split(split(triggerOutputs()?['body/body'], '[https://')[1], ']')[0]))

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the quick reply @Expiscornovus below you find the result and how the email looks in original
    ibenetos_0-1666167923891.png

    this is how the email looks

    ibenetos_1-1666168189843.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    "body": "<html><head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta name=\"Generator\" content=\"Microsoft Word 15 (filtered medium)\"><style>\r\n<!--\r\n@font-face\r\n\t{font-family:\"Cambria Math\"}\r\n@font-face\r\n\t{font-family:Calibri}\r\n@font-face\r\n\t{font-family:Tahoma}\r\n@font-face\r\n\t{font-family:remialcxesans}\r\n@font-face\r\n\t{font-family:template-zhbAo9YwEem16QAD_wDF7A}\r\np.MsoNormal, li.MsoNormal, div.MsoNormal\r\n\t{margin:0cm;\r\n\tfont-size:11.0pt;\r\n\tfont-family:\"Calibri\",sans-serif}\r\na:link, span.MsoHyperlink\r\n\t{color:#0563C1;\r\n\ttext-decoration:underline}\r\nspan.E-MailFormatvorlage17\r\n\t{font-family:\"Calibri\",sans-serif;\r\n\tcolor:windowtext}\r\n.MsoChpDefault\r\n\t{font-family:\"Calibri\",sans-serif}\r\n@page WordSection1\r\n\t{margin:70.85pt 70.85pt 2.0cm 70.85pt}\r\ndiv.WordSection1\r\n\t{}\r\n-->\r\n</style></head><body lang=\"DE\" link=\"#0563C1\" vlink=\"#954F72\" style=\"word-wrap:break-word\"><div class=\"WordSection1\"><p class=\"MsoNormal\">This test <a href=\"https://kb.confluence.com/\">URL</a></p><p class=\"MsoNormal\">
  • Verified answer
    Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @Anonymous,

     

    Sorry, I missed the part where you used the HTML to text.

     

    In that case you need to use:

    if(equals(indexOf(body('Html_to_text'), '[https://'), -1), 'Link not Found', concat('https://',split(split(body('Html_to_text'), '[https://')[1], ']')[0]))

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard