HI
Here is the idea
I would like to send out an email based on the data selected.
Below is the example:
1. When the data is selected
2. A new row in collection will be created
3. Below shows the images info in attachment collection table
4. An email will be sending out after user clicked on "report" button
Questions:
How do I search the images' title start with "Before" and put them in Finding column ?
Also search the images' title start with "After" and put them in Rectification column?
Thank you
Solved! Go to Solution.
Hi @pityman ,
I did a test for you:
1\ This is my test collection
2\ I assume that my table in the html body has three columns, they are "BBB", "image1(jpg)" and "image2(png)".
The image1(jpg) column only has attachments in .jpg format.
The image2(png) column only has attachments in .PNG format.
3\ Add a button control and set its onselect property to:
Office365Outlook.SendEmail(
"your email",
"Test222",
Concatenate(
"<table style=""width:100%"" border=""1"">
<tr>
<th>BBB</th>
<th>image1(jpg)</th>
<th>image2(png)</th>
</tr>",
Concat(
ForAll(
Test2,
"
<tr>
<td>" & ThisRecord.BBB & "</td>
" & "<td>" & Concat(
Filter(
ForAll(
ThisRecord.image,
If(
"jpg" in ThisRecord.DisplayName,
"<img src=""" & ThisRecord.AbsoluteUri & """>"
)
),
!IsBlank(Value)
),
Value
) & "</td>" & "<td>" & Concat(
Filter(
ForAll(
ThisRecord.image,
If(
"png" in ThisRecord.DisplayName,
"<img src=""" & ThisRecord.AbsoluteUri & """>"
)
),
!IsBlank(Value)
),
Value
) & "</td>" & "
</tr>
"
),
Value
),
"</table>"
),
{IsHtml: true}
)
4\ The result is as follows:
So, you could try the fomula like this:
Office365Outlook.SendEmail(
"your email",
"Test222",
Concatenate(
"<table style=""width:100%"" border=""1"">
<tr>
<th>BBB</th>
<th>Finding</th>
<th>Rectification</th>
</tr>",
Concat(
ForAll(
FilteredCollection,
"
<tr>
<td>" & ThisRecord.No & "</td>
" & "<td>" & Concat(
Filter(
ForAll(
ThisRecord.image,
If(
"before" in ThisRecord.DisplayName,
"<img src=’" & ThisRecord.AbsoluteUri & "’>"
)
),
!IsBlank(Value)
),
Value
) & "</td>" & "<td>" & Concat(
Filter(
ForAll(
ThisRecord.image,
If(
"after" in ThisRecord.DisplayName,
"<img src=’" & ThisRecord.AbsoluteUri & "’>"
)
),
!IsBlank(Value)
),
Value
) & "</td>" & "
</tr>
"
),
Value
),
"</table>"
),
{IsHtml: true}
)
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hey @pityman
You can use the IsMatch function to find the required images like:
IsMatch(image.Name, "After", MatchOptions.BeginsWith);
HI @Elias-V ,Thanks for your reply
However how do i get the uri and set the <img src> in html?
Hi @pityman ,
I did a test for you:
1\ This is my test collection
2\ I assume that my table in the html body has three columns, they are "BBB", "image1(jpg)" and "image2(png)".
The image1(jpg) column only has attachments in .jpg format.
The image2(png) column only has attachments in .PNG format.
3\ Add a button control and set its onselect property to:
Office365Outlook.SendEmail(
"your email",
"Test222",
Concatenate(
"<table style=""width:100%"" border=""1"">
<tr>
<th>BBB</th>
<th>image1(jpg)</th>
<th>image2(png)</th>
</tr>",
Concat(
ForAll(
Test2,
"
<tr>
<td>" & ThisRecord.BBB & "</td>
" & "<td>" & Concat(
Filter(
ForAll(
ThisRecord.image,
If(
"jpg" in ThisRecord.DisplayName,
"<img src=""" & ThisRecord.AbsoluteUri & """>"
)
),
!IsBlank(Value)
),
Value
) & "</td>" & "<td>" & Concat(
Filter(
ForAll(
ThisRecord.image,
If(
"png" in ThisRecord.DisplayName,
"<img src=""" & ThisRecord.AbsoluteUri & """>"
)
),
!IsBlank(Value)
),
Value
) & "</td>" & "
</tr>
"
),
Value
),
"</table>"
),
{IsHtml: true}
)
4\ The result is as follows:
So, you could try the fomula like this:
Office365Outlook.SendEmail(
"your email",
"Test222",
Concatenate(
"<table style=""width:100%"" border=""1"">
<tr>
<th>BBB</th>
<th>Finding</th>
<th>Rectification</th>
</tr>",
Concat(
ForAll(
FilteredCollection,
"
<tr>
<td>" & ThisRecord.No & "</td>
" & "<td>" & Concat(
Filter(
ForAll(
ThisRecord.image,
If(
"before" in ThisRecord.DisplayName,
"<img src=’" & ThisRecord.AbsoluteUri & "’>"
)
),
!IsBlank(Value)
),
Value
) & "</td>" & "<td>" & Concat(
Filter(
ForAll(
ThisRecord.image,
If(
"after" in ThisRecord.DisplayName,
"<img src=’" & ThisRecord.AbsoluteUri & "’>"
)
),
!IsBlank(Value)
),
Value
) & "</td>" & "
</tr>
"
),
Value
),
"</table>"
),
{IsHtml: true}
)
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
@v-xiaochen-msft you are superb!
dont mind if i ask you , did you encounter below issue before?
I send to my email no issues, i can see the images. but when i send to others, they are not able to see the images
Hi @pityman ,
This is essentially a URL, so you need to share the list to users.
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.