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.
- 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).
- Set Up Power Automate:
- Go to Power Automate.
- Click on Create and choose Automated flow.
- 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.
- 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]+')
- 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.
- 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.