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 Apps / Send CSV from power ap...
Power Apps
Unanswered

Send CSV from power app without flow

(0) ShareShare
ReportReport
Posted on by 83
Hi, 
 
a get an error like the atachement can't be empty:
 
Set(
    varCSVData,
    "DATA_SOLICITARE_OFERTA,NR_OFERTA_FURNIZOR,NR_OFERTA_CUMPARATOR, NR_AUTO_CLIENT, VIN, COD_AUDATEX,TIP_PIESA, DENUMIRE,COD_FURNIZOR,PRODUCATOR, CANTITATE, PRET_AUDATEX,DATA LIVRARE, OBSERVATII" &
    Concat(
        colGalleryData,
        Subtitle4_13.Text & "," &
        " " & "," &
        Subtitle4_15.Text & "," &
        Subtitle4_14.Text & "," &
        Subtitle4_17.Text & "," &
        TextInput2.Text & "," &
        " " & "," &
        TextInput2_3.Text & "," &        
        " " & "," &
        " " & "," &
        Subtitle4_21.Text & "," &
        Subtitle4_22.Text & "," &
         " " & "," &
        TextInput2_3.Text & Char(10)  // Char(10) adds a new line
    )
);
 
// Encode the CSV data as Base64
Set(
    varCSVBase64,
    JSON(
        {
            'Name': Subtitle4_14.Text & ".csv",
            'ContentBytes': varCSVData
        },
        JSONFormat.IncludeBinaryData
    )
);
 
// Send the email with the Base64-encoded CSV attached
Office365Outlook.SendEmail(
    TextInput2_2.Text,
    "Solicitare oferta de pret, pentru comanda " & Subtitle4_15.Text & ", nr auto: " & Subtitle4_14.Text & ", " & Today(),
    varEmailBody,
    {
        Attachments: Table(
            {
                Name: Subtitle4_14.Text & ".csv",  // Name of the file
                ContentBytes: varCSVBase64  // Pass Base64-encoded CSV data
            }
        ),
        IsHtml: true,
        BCC: TextInput2_2.Text
    }
);
I have the same question (0)
  • WarrenBelz Profile Picture
    155,184 Most Valuable Professional on at
    Unfortunately you need a Flow. JSON coding still does not turn it into the file type expected by Outlook. This is an old Flow of mine that has been working for a long time (I would use the V2 trigger now), however you do not need to apply and JSON conversion - just send varCSVData and the other content to the Flow. You just need to create a file in OneDrive and use the content of that.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
     
     

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 Apps

#1
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard