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 Apps / Replace plaintext link...
Power Apps
Unanswered

Replace plaintext link with HTML Hyperlink

(0) ShareShare
ReportReport
Posted on by 22

Hi,

 

I'm using a flow to grab all tweets from a handful of user and upload them into a SP list.

 

This is working great, but in a lot of these tweets, there is shared content. I need to be a way to grab that link out of the text and convert it into a html hyperlink, it varies in location which makes it slightly harder.

 

Does anyone have any ideas how I can make this work?

 

Thanks!

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @connorwigg 

    You can consider using the Match function to get the link from the html text.

    Ex.

    Match("<html><b><a href='https://someplace.com/something'>some anchor text</a>", "<a\s+href=(?:""([^""]+)""|'([^']+)').*?>(.*?)</a>").FullMatch

    Will return:

        <a href='https://someplace.com/something'>some anchor text</a>

     

    For that you will have the full hyperlink.

     

    I hope this is helpful for you.

     

     

  • connorwigg Profile Picture
    22 on at

    Hi @RandyHayes.

     

    That doesn't appear to do what I'm after, the link is different in each post, and with that code all I'm getting is the same link (https://t.co.) rather than one of the full links in the text.

     

    do you have any other ideas?

     

    Thanks,

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @connorwigg 

    This depends.  It will only return one of the links.  Do you have multiple in the text you are supplied to the match function?

  • connorwigg Profile Picture
    22 on at

    Hi @RandyHayes 

     

    There's sometimes multiple links and it's always a different link, always with the prefix of https://t.co. though which might help.

     

    Any ohher ideas?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @connorwigg 

    Are you stating that the text you have has multiple links but the ONLY one you want is the one that starts with https://t.co?  Or am I misunderstanding that?

     

  • connorwigg Profile Picture
    22 on at

    @RandyHayes 

     

    Multiple links, all starting with https://t.co.

     

    Thanks

  • connorwigg Profile Picture
    22 on at

    @RandyHayes 

     

    Perhaps this will help.. this is a screenshot of the app. Only one link in these though, and it isn't always at the endMicrosoftTeams-image (15).png

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @connorwigg 

    Okay, slightly confused then over your first post that said "grab that link".

     

    If you have a series of links in the text, then you can get a table of those links with the following formula:

    MatchAll(yourText, "<a\s+href=(?:""([^""]+)""|'([^']+)').*?>(.*?)</a>")

    The formula returns a table with multiple columns from the Match.  One of which is FullMatch.

    That will contain the link recognized by the match.

    So you will have a table of all the matches of all the links in the text.

     

  • connorwigg Profile Picture
    22 on at

    Hi @RandyHayes 

     

    Really sorry to keep coming back.

    I've tried to simplify the app as much as possible and build a collection based on your sample code, but it isn't working.

     

    Here's a pic of what I'm doing. Am I missing something obvious?

    connorwigg_0-1619520750107.png

     

  • connorwigg Profile Picture
    22 on at

    @RandyHayes I think I'm starting to understand why this isn't working.

     

    I'm looking to extract the plaintext link which in turn will allow me to convert it into HTML.

     

    Now that I look closer at your code, that seems to be looking for a link thats already in HTML format, am I right?

     

    I need to be able to extract the Plaintext URLS out and convert them into HTML...

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 Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard