cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mjetek404
Frequent Visitor

Sending PenInput as an image with other attachments by one email

Hi, 

 

I know the code to send any attachments.

{Attachments:RenameColumns(Attachments1.Attachments,"Value", "ContentBytes")}

 

I also know the code to send PenInput as an image in the attachments.

{Attachments:Table({Name:"PenInput.jpg",ContentBytes:PenInput.Image , '@odata.type':""})}

 

Everything works fine as I send them separately.

 

How can I send any attachment with PenInput as an image together in a single e-mail?

How can I combine these codes?

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Mjetek404,

Based on the issue that you mentioned, do you want to send a PenInput image combining with the Attatchment in an email?

Could you please share a bit more about the scenario?

I think if you want to combine the PenInput image with the Attachment image, you should create a collection to save both of them, then refer to the collection in the Attachment.

I have a test on my side, please take a try as below.

1). Create a collection to store your image in the Attachment1:

ClearCollect(ColAttach,Attachments1.Attachments)

2). Save the PenInput image into the collection:

Patch(ColAttach,Defaults(ColAttach),{DisplayName:"PenInput.jpg",Value:PenInput1.Image})

Note that a collection with attachments looks like below, and if you want to save the PenInput image, you should refer to the DisplayName and Value column as above.

vqiaqimsft_0-1624433207470.png

3). Add a button and set the OnSelect to send an email as below:

Office365Outlook.SendEmailV2(
    "qiqiao@xxx.onmicrosoft.com",
    "Test",
    "Hola!",
    {
        Attachments: ForAll(
            ColAttach,
            {
                Name: DisplayName,
                ContentBytes: Value
            }
        )
    }
)

Check as below:

vqiaqimsft_1-1624433388365.png

Regards,

Qi

 

 

 

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @Mjetek404,

Based on the issue that you mentioned, do you want to send a PenInput image combining with the Attatchment in an email?

Could you please share a bit more about the scenario?

I think if you want to combine the PenInput image with the Attachment image, you should create a collection to save both of them, then refer to the collection in the Attachment.

I have a test on my side, please take a try as below.

1). Create a collection to store your image in the Attachment1:

ClearCollect(ColAttach,Attachments1.Attachments)

2). Save the PenInput image into the collection:

Patch(ColAttach,Defaults(ColAttach),{DisplayName:"PenInput.jpg",Value:PenInput1.Image})

Note that a collection with attachments looks like below, and if you want to save the PenInput image, you should refer to the DisplayName and Value column as above.

vqiaqimsft_0-1624433207470.png

3). Add a button and set the OnSelect to send an email as below:

Office365Outlook.SendEmailV2(
    "qiqiao@xxx.onmicrosoft.com",
    "Test",
    "Hola!",
    {
        Attachments: ForAll(
            ColAttach,
            {
                Name: DisplayName,
                ContentBytes: Value
            }
        )
    }
)

Check as below:

vqiaqimsft_1-1624433388365.png

Regards,

Qi

 

 

 

Best Regards,
Qi

View solution in original post

@v-qiaqi-msft Thank you for your help : )

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
Top Kudoed Authors
Users online (2,030)