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 Automate / Extract a URL from a m...
Power Automate
Unanswered

Extract a URL from a message in a teams chat.

(0) ShareShare
ReportReport
Posted on by 2
Hi all, 
 
I am trying to create a flow that will recognise when a message is posted in a group Teams chat and if that message contains a URL I need it to strip out the URL and save it in an excel document on SharePoint
 
I did build it and got errors so asked Copilot where i was going wrong. it gave me multiple different solutions, none of which worked so I asked it to design the flow. It basically gave me the same as I built but it still doesn't work. 
 
Any help would be really appreciated as im pulling my hair out!
 
This is what i'm working with currently. 
 
 
  1. Create an Excel File on SharePoint:
    • Go to your SharePoint site.
    • Create a new Excel file and name it (e.g., TeamsURLs.xlsx).
    • Add a table with columns for the URL and any other information you want to capture (e.g., Timestamp, Sender).
  2. Set Up Power Automate:
    • Go to Power Automate.
    • Click on Create and choose Automated flow.
  3. Trigger:
    • Search for the Microsoft Teams connector.
    • Select the trigger When a new message is posted in a chat or channel.
    • Configure the trigger to monitor the specific chat or channel where you want to extract URLs.
  4. Extract URLs:
    • Add a new step and choose Compose action.
    • Use an expression to extract URLs from the message content. You can use the match function with a regular expression to find URLs.
 
Example expression:
match(triggerOutputs()?['body']?['text'], 'https?://[^\s]+')
  1. Add a Row to Excel:
    • Add a new step and choose the Excel Online (Business) connector.
    • Select Add a row into a table action.
    • Configure it to point to your SharePoint site, the Excel file, and the table you created.
    • Map the extracted URL and other information to the appropriate columns.
  2. Save and Test:
    • Save your flow and test it by posting a message with a URL in the monitored Teams chat or channel.
    • Check your Excel file on SharePoint to see if the URL has been added.
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi
     
    Can you explain by it doesn't work means?
     
    Can you please share an example of the data from Teams so we can better answer if the match is correct or not and help you solve it. without a data example its very very hard.
     
  • JA-05031650-0 Profile Picture
    2 on at
    Hi, @AlexEncodian
     
    The two options you suggested are both subscriptions which I dont want to use. I am looking for a way to do this within Power Automate if possible. 
     
    @Michael E. Gernaey, By it doesnt work i mean that i get an error and then when i correct the error it gives me a different error so end up chasing my tail. The text could be anything but will potentially include a URL within the text. This is what im looking to extract.
     
    Thanks

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard