I've built a flow to send an email that lists all files in a given folder that have not been modified in the past 24 hours. Everything works great - except it sends a unique email for each file. I want to send a single email with a list of all the files that meet the condition (i.e. haven't been modified in the past 24 hours). My guess is I need to use some kind of array function in the body of the email, but I don't know how to construct that.
Help please!
Solved! Go to Solution.
Here is one method that combines a number of steps:
Note that 'Past time' is enclosed in single quotes
Next we Select the the Filename with Extension and Modified date from the data returned by the Get files (properties only) action, convert that to a HTML table and email it to the recipient:
Here is the sample output:
You could refine the HTML table by formating the date/time to your locale, add some simple HTML improve the layout of the table.
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
If you would like to format the date/time and the HTML table that is sent in the email:
We add an expression to format the date and time (note date/time in SharePoint is stored as UTC):
This is the HTML table formatting code:
You can copy-and-paste the HTML code below:
<style>
table {
border: 1px solid #1C6EA4;
background-color: #EEEEEE;
width: 100%;
text-align: left;
border-collapse: collapse;
table-layout: auto;
}
table td, table th {
border: 1px solid #AAAAAA;
padding: 10px;
}
table tbody td {
font-size: 13px;
}
table thead {
background: #1C6EA4;
border-bottom: 2px solid #444444;
}
table thead th {
font-size: 15px;
font-weight: bold;
text-align: left;
color: #FFFFFF;
border-left: 2px solid #D0E4F5;
}
table thead th:first-child {
border-left: none;
}
</style>
Add the HTML formatting code to the email:
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
Can you share a screenshot of the Get files (properties only) action and the filter query?
You should be able to copy-and-paste the following expression and re-test the flow:
Modified lt '@{body('Get_past_time')}'
Ellis
Here is one method that combines a number of steps:
Note that 'Past time' is enclosed in single quotes
Next we Select the the Filename with Extension and Modified date from the data returned by the Get files (properties only) action, convert that to a HTML table and email it to the recipient:
Here is the sample output:
You could refine the HTML table by formating the date/time to your locale, add some simple HTML improve the layout of the table.
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
If you would like to format the date/time and the HTML table that is sent in the email:
We add an expression to format the date and time (note date/time in SharePoint is stored as UTC):
This is the HTML table formatting code:
You can copy-and-paste the HTML code below:
<style>
table {
border: 1px solid #1C6EA4;
background-color: #EEEEEE;
width: 100%;
text-align: left;
border-collapse: collapse;
table-layout: auto;
}
table td, table th {
border: 1px solid #AAAAAA;
padding: 10px;
}
table tbody td {
font-size: 13px;
}
table thead {
background: #1C6EA4;
border-bottom: 2px solid #444444;
}
table thead th {
font-size: 15px;
font-weight: bold;
text-align: left;
color: #FFFFFF;
border-left: 2px solid #D0E4F5;
}
table thead th:first-child {
border-left: none;
}
</style>
Add the HTML formatting code to the email:
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
Ellis -
Thank you for this excellent guidance! It all works great - but only if I leave out the Get past time element (which results in every record in the file being included). When I include that piece, it throws an error:
I tried removing the "Modified It" part and just using the Past Time element - but that didn't help. Any ideas why it's tripping an error?
Can you share a screenshot of the Get files (properties only) action and the filter query?
You should be able to copy-and-paste the following expression and re-test the flow:
Modified lt '@{body('Get_past_time')}'
Ellis
I'm not sure what I was doing wrong when I tried to enter it manually, but the copy/past of the extended expression worked. It works perfectly. Thanks again!
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 |
---|---|
67 | |
24 | |
16 | |
16 | |
13 |
User | Count |
---|---|
116 | |
35 | |
32 | |
28 | |
26 |