cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
diguzzo
Level: Powered On

Gmail attachments type error

Im trying to send mail with Gmail and attached one or more images.

I tried to configure the app with camera control or with add image but everytime I have the same error into send button.

I use, as example, the follow command into OnSelect:

Gmail.SendEmail("xxx@yyyyy.com";{Attachments:Table({Name:"pic.jpg"; ContentBytes:UploadedImage1.Image; '@odata.type':""})})

The error that I have eveytime is:

Type not compatible. The "ContentBytes" column in the data source being updated expected a "Blob" type but an "Image" type has been used.

 

May you help me?

Thanks in advantage for all info.

 

ciao

Diego

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Gmail attachments type error

Hi @diguzzo,

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side.

Based on the error message that you provided, it seems to tell that there is something wrong with the value you provided for the ContentBytes property.

Within the Gmail.SendEmail() formula, the ContentBytes proeprty is required to provided a Blob type data, but the Blob type data is not supported within PowerApps currently.

Note: The result the AddMediaButton1.Media formula returned is a blog URL data, which would be recognized as a Text type by PowerApps. The result the UploadedImage1.Image returned is a Image type data.

If you want to send a Gmail email with an attachment within PowerApps, I afraid that there is no way to achieve your needs in PowerApps currently.

 

As an alternative solution, I think Microsoft Flow could achieve your needs. On your side, you could consider pass the captured picture (captured via Camera control or Add Picture control) to a flow, then within the flow send an gmail email with the passed picture file as the attachment.

1. If you use Camera control to capture the picture, please take a try to configure your flow as below:13.JPG

Within the "Send Email" action, set the Attachments Content 1 field to following formula:

dataUriToBinary(triggerBody()['Sendemail_Attachments']['ContentBytes'])

Please check the following blog for more details:

https://www.techmikael.com/2017/05/an-even-more-clever-workaround-for.html

More details about using expression in flow actions, please check the following blog:

https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/

 

2. If you captured your picture using Add Picture control, you need to create a custom connector within your PowerApps/MS Flow, then use the custom connector to pass captured picture to a flow. I have made a test on my side, please configure your flow as below:14.JPG

Please check and see if the following blog would help in your scenario:

http://repointtechnologies.com/saving-images-from-powerapps-to-sharepoint/

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
panand99
Level 10

Re: Gmail attachments type error

Hi,

 

you can view below youtube video by Shane Young:

 

https://www.youtube.com/watch?v=V3feURQfY3M

 

 

diguzzo
Level: Powered On

Re: Gmail attachments type error

Dear panand99,

Already try but same error: "expected a "Blob" type but an "Image" type has been used."

Ciao

Diego

Community Support Team
Community Support Team

Re: Gmail attachments type error

Hi @diguzzo,

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side.

Based on the error message that you provided, it seems to tell that there is something wrong with the value you provided for the ContentBytes property.

Within the Gmail.SendEmail() formula, the ContentBytes proeprty is required to provided a Blob type data, but the Blob type data is not supported within PowerApps currently.

Note: The result the AddMediaButton1.Media formula returned is a blog URL data, which would be recognized as a Text type by PowerApps. The result the UploadedImage1.Image returned is a Image type data.

If you want to send a Gmail email with an attachment within PowerApps, I afraid that there is no way to achieve your needs in PowerApps currently.

 

As an alternative solution, I think Microsoft Flow could achieve your needs. On your side, you could consider pass the captured picture (captured via Camera control or Add Picture control) to a flow, then within the flow send an gmail email with the passed picture file as the attachment.

1. If you use Camera control to capture the picture, please take a try to configure your flow as below:13.JPG

Within the "Send Email" action, set the Attachments Content 1 field to following formula:

dataUriToBinary(triggerBody()['Sendemail_Attachments']['ContentBytes'])

Please check the following blog for more details:

https://www.techmikael.com/2017/05/an-even-more-clever-workaround-for.html

More details about using expression in flow actions, please check the following blog:

https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/

 

2. If you captured your picture using Add Picture control, you need to create a custom connector within your PowerApps/MS Flow, then use the custom connector to pass captured picture to a flow. I have made a test on my side, please configure your flow as below:14.JPG

Please check and see if the following blog would help in your scenario:

http://repointtechnologies.com/saving-images-from-powerapps-to-sharepoint/

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,157)