Hi All,
We have a Private channel within a Private Team, with several external members/guests.
Is there a way via MS Flow to send every 30 minutes - the new chat logs of a specific channel to a mail address?
Solved! Go to Solution.
Hi @dB4,
There are steps shown below:
1. Initialize an array variable named Attachments:
2. Then put the body of Filter query (previous reply shows) into the Apply to each action, then put the Message attachment into Apply to each action 2 body.
3. Cause the attachment content URL contains full URL of the attachment, so we should use split() function to remove the web site part of the URL, the "Westero" is my side name, you should enter your site name in here.
split(item()?['contentUrl'],'Westeros')[1]
4. After we get the file path at step 3, we should use Get file content by path to get the file content, and use Get file metadata action to get the file name by using the file path that converted into the URI code:
uriComponent(outputs('Compose'))
5. Then we get the file content and file name, the last thing we need to do is put them into the array variable:
{
"Name": "@{body('Get_file_metadata')?['Name']}",
"ContentBytes": "@{body('Get_file_content_using_path')}"
}
6. Then put the variable into the Email attachment field, we should switch the attachment mode to input entire array:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dB4,
Yes, you could refer to the following steps:
1. Create a recurrence trigger runs every 30 minutes;
2. Get messages of the channel;
3. Filter array, get last 30 minutes messages;
4. Create HTML table to inserted in Email.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dear @v-litu-msft Good day,
Thanks for your input, works like a charm!
Can we just get the logs as plain text on the body of the email instead of html?
Hi @dB4,
Yes, you could edit the return content in the Create HTML table action:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-litu-msft , i will try this afterwards.
Note that i utilized the ready template for Teams messages to Email, but i cannot get attachments to be shown in email.
Please check the below screenshots.
Hi @dB4,
The uploaded attachment is store in the library of SharePoint site belong to team, you could use the Get file content by using path action of SharePoint connector to get these file content, then add them into the email attachment field to send out.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dB4,
There are steps shown below:
1. Initialize an array variable named Attachments:
2. Then put the body of Filter query (previous reply shows) into the Apply to each action, then put the Message attachment into Apply to each action 2 body.
3. Cause the attachment content URL contains full URL of the attachment, so we should use split() function to remove the web site part of the URL, the "Westero" is my side name, you should enter your site name in here.
split(item()?['contentUrl'],'Westeros')[1]
4. After we get the file path at step 3, we should use Get file content by path to get the file content, and use Get file metadata action to get the file name by using the file path that converted into the URI code:
uriComponent(outputs('Compose'))
5. Then we get the file content and file name, the last thing we need to do is put them into the array variable:
{
"Name": "@{body('Get_file_metadata')?['Name']}",
"ContentBytes": "@{body('Get_file_content_using_path')}"
}
6. Then put the variable into the Email attachment field, we should switch the attachment mode to input entire array:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
70 | |
25 | |
16 | |
16 | |
14 |
User | Count |
---|---|
145 | |
45 | |
43 | |
33 | |
30 |