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

Notifications

Announcements

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:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 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,297 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,297 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,297 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard