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

Notifications

Announcements

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
    153,061 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard