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

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.

View solution in original post

pityman
Helper II
Helper II

@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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,268)