cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pityman
Helper III
Helper III

Search image file and put in html column

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 

 

pityman_4-1615965966166.png

 


2. A new row in collection will be created 

 

pityman_5-1615965992970.png

3.  Below shows the images info in attachment collection table

pityman_6-1615966029733.png

 


4. An email will be sending out after user clicked on "report" button 

pityman_7-1615966044164.png

 

 

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @pityman ,

 

I did a test for you:

1\ This is my test collection

v-xiaochen-msft_0-1615972332487.png

 

v-xiaochen-msft_1-1615972332493.png

 

v-xiaochen-msft_2-1615972332495.png

 

 

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:

v-xiaochen-msft_3-1615972332529.png

 

 

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.

View solution in original post

5 REPLIES 5
Elias-V
Advocate I
Advocate I

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?

v-xiaochen-msft
Community Support
Community Support

Hi @pityman ,

 

I did a test for you:

1\ This is my test collection

v-xiaochen-msft_0-1615972332487.png

 

v-xiaochen-msft_1-1615972332493.png

 

v-xiaochen-msft_2-1615972332495.png

 

 

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:

v-xiaochen-msft_3-1615972332529.png

 

 

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.

pityman
Helper III
Helper III

@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

pityman_0-1615974559299.png

 

v-xiaochen-msft
Community Support
Community Support

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.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,546)