web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / sending attachment tho...
Power Automate
Answered

sending attachment though power apps to power automate but data is incomplete

(0) ShareShare
ReportReport
Posted on by 114

I made an app that uploads its attachment to Power automate so that I can send it to an email as an attachment, here is the formula am using to get attachment data:

 

Set(data, JSON(Image3.Image, JSONFormat.IncludeBinaryData));

Collect(rawdata, {contentBytes: Mid(data, Find(",", data)+1, Len(data) - Find(",", data) -1), name:Last(Ducements.Attachments).Name});

 

 

GTurkistane_0-1704020293787.png

 

 

and here is how it is sent to the flow:

 

SendEmailAttV2.Run(JSON(rawdata));

 

here is the flow am using to process the data nd send it in an email:

GTurkistane_1-1704020293839.png

 

 

Schema:

 

{
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "name": {
 "type": "string"
 },
 "contentBytes": {
 "type": "string"
 }
 },
 "required": [
 "name",
 "contentBytes"
 ]
 }
}

 

GTurkistane_2-1704020293701.png

 

 

upon receiving the email, i can not open any of the attachment saying that it is corrupted, they all have correct names and types, here is the flow run:

 

 

GTurkistane_3-1704020293619.png

 

 

GTurkistane_4-1704020293973.png

 

 

GTurkistane_5-1704020294100.png

 

 

GTurkistane_6-1704020293511.png

 

NOTE: i am required that i send the emails from power automate and can not just simply send it from power apps

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @GTurkistane ,

    After doing a Parse JSON, we can now use it in a loop and then using the “Convert” action, we will convert the “ContentBytes” property from Base64 to Binary using the following code.
    vyetonggumsft_5-1704023335315.png
     

     

    @{base64ToBinary(items('Apply_to_each')['ContentBytes'])}

     

    After doing a conversion, we will now append this value to our array along with the filename.

    vyetonggumsft_8-1704023604528.png
    vyetonggumsft_9-1704023615508.png

    Best Regards,

    Sunshine Gu

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 598

#2
Valantis Profile Picture

Valantis 477

#3
Vish WR Profile Picture

Vish WR 370

Last 30 days Overall leaderboard