We have a Teams Channel where daily posts are made with links to various websites. Is it possible to create a Power Automate flow that is automatically triggered by a new post in Teams to extract the links that are posted?
Solved! Go to Solution.
@EaEberhardt please follow below steps to extract the link
1. Add Initialize Variable action and name the variable as link
2. Add Compose action and configure below expression
split(triggerOutputs()?['body/body/content'],'<a ')
3. Add Apply to each loop and use outputs of compose action in it
4. Add Condition action on left side select Current Item from Dynamic content, in dropdown select startswith and on right side provide value href
5. Under yes branch of condition, add Set Variable action, select Link variable and configure below expressions in it
replace(replace(substring(items('Apply_to_each'),0,indexOf(items('Apply_to_each'), ' ')),'href="',''),'"','')
See screenshot below for full flow
@EaEberhardt You can create a flow with trigger "When a new channel message is added". So that flow triggers everytime a new channel message is posted. In terms of extracting link, do you expect multiple links in single message?
Thank you for the reply. There is only one link per post. But it can be part of a longer text
@EaEberhardt please follow below steps to extract the link
1. Add Initialize Variable action and name the variable as link
2. Add Compose action and configure below expression
split(triggerOutputs()?['body/body/content'],'<a ')
3. Add Apply to each loop and use outputs of compose action in it
4. Add Condition action on left side select Current Item from Dynamic content, in dropdown select startswith and on right side provide value href
5. Under yes branch of condition, add Set Variable action, select Link variable and configure below expressions in it
replace(replace(substring(items('Apply_to_each'),0,indexOf(items('Apply_to_each'), ' ')),'href="',''),'"','')
See screenshot below for full flow
@EaEberhardt did you get chance to apply above solution?
Thank you! Works perfectly!
User | Count |
---|---|
26 | |
16 | |
14 | |
10 | |
10 |
User | Count |
---|---|
45 | |
29 | |
29 | |
23 | |
23 |