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 hyperlink from...
Power Automate
Answered

Extract hyperlink from an email and make a new file in a specific folder in a team OR in a channel

(1) ShareShare
ReportReport
Posted on by 16

Hello everyone,

 

I have a very specific request and I'd love to know if there's any way to do it. If not, any alternative is welcome !

 

Context : A shared mailbox will be receiving emails. Those emails will contain an unique Smartsheet button/hyperlink (it will lead to an update request for a new row created in the the said Smartsheet), like this : 

smartsheet_button.png

I need to share that hyperlink/button/URL/whatever to a specific team in Teams, either it be as a file in a specific folder or as a new post in a channel created specifically for that. Members will be able to open and reply to the request from the team, not from the shared mailbox.

 

The first option that I could think of, with a file in a specific folder : what I would like to do ideally is, when a new email is received, the content (ideally, just the body of the email + the hyperlink) is extracted and created as a new file in a specific folder in a Team. The title of the file would be something like "TimeReceived+EmailObject" and, once opened, would provide the URL from the hyperlink. If possible, the file would simply contain the button and some of the body of the email, but I'm sure it's more difficult to implement. Honestly, even if it's just the full email in a file with the button (or the full URL, at least), that'd be okay.

 

__________________________________________________________________

If that's not possible, I have an alternative that could also be great (maybe even better ?...) : I have created a specific channel in the team that could host every new mails sent to the shared mailbox. I've done the "When a new email arrives in a shred mailbox -> Post adaptive card and wait for a response", but the issue here is that I can't seem to find a way to only show in the adaptative card the hyperlink/URL from the Smartsheet button. 

 

It only show a small part of the very beginning of the email (like who it's from, who it's sent to, etc.). It's pretty much useless as of right now. 

 

If I could specify in the adaptive card to only show either the button URL, the button itself, or at least the part of the email where that is present, that'd be amazing.

 

 

I hope I'm clear in what I'm trying to say, I'm available if anyone need more specifications. 

 

Thanks a lot in advance, have a great day ! 

 

Categories:
  • WillPage Profile Picture
    2,339 Super User 2026 Season 1 on at

    You can parse the URL out of the HTML body of the email using the slice() function. Examine the raw HTML and identify where unique strings exist that indicates the start and end of the href tag. e.g

    <a href="https://some-link.here.com/clickme?uniqueId=gcef76c48g37frscghgvfb">Open Request</a>

    You could extract using slice like this:

    slice(outputs('Mail_body'),indexOf(outputs('Mail_body'),'https://some-link.here.com'),indexOf(outputs('Mail_body'),'">Open Request'))

     

    In this case you're looking for the position of the start part of the URL that remains the same between each email (the domain) as the starting position of your slice, then we find the end, for which I've used the the closing quotes & tag and link text.

    outputs('Mail_body') here is your text as if it's in a Compose action called Mail body. The strings you use to identify the start and end will vary from this example. indexOf() returns the start position of the search text so combine with sub() or add() to go forward or back from the search text to get the beginning and end of the actual URL itself if needed.

  • Shortcube Profile Picture
    16 on at

    This might be a bit more within the grasp of my abilities lol, but in my specific context do you have any idea of which actions and or triggers I have to implement before/after the Extract URL action ? 

     

    Do I have to format the email to something specific (like a PDF) ? Will it works if the URL is within a button ? 

    Thanks a lot in advance for your reply ! 

  • Verified answer
    Shortcube Profile Picture
    16 on at

    I ended up with a solution, here's what it looks like : 

    Shortcube_0-1720187489620.png

     

     

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 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard