Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

 

 

  • Verified answer
    v-yetonggu-msft Profile Picture
    on at
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow