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

Community site session details

Session Id : k6jq9OrRmMpVBWPiYMNLPD
Power Automate - Using Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 31 Dec 2023 11:01:12 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

 

 

  • Verified answer
    v-yetonggu-msft Profile Picture
    on 31 Dec 2023 at 11:51:04
    Re: sending attachment though power apps to power automate but data is incomplete

    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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Featured topics

Restore a deleted flow
Loading complete