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 / Clearing Attachments w...
Power Apps
Unanswered

Clearing Attachments when Using the Email Template

(0) ShareShare
ReportReport
Posted on by 228

I'm using PowerApps email template and I'm having trouble with clearing the attachments once the email has been sent. If a user wants to submit another email for another request type immediately after submittal of the first request, when they return to the form, the previous attachments are still present. The current code on the send button is as shown below. Is there something in it I need to tweak in order to get the attachments to clear on send?

 

 /*Create semicolon separated list of people to email, send the email, reset subject & message fields*/
Set(_emailRecipientString, Concat(MyPeople, Mail & ";"));

Office365Outlook.SendEmailV2(_emailRecipientString, TextEmailSubject2.SelectedText.Value, RTEBody.HtmlText, {Attachments: RenameColumns(Attach.Attachments, "Value", "ContentBytes"),Importance:"Normal"});
Reset(TextEmailSubject2);
Reset(RTEBody);
Clear(MyPeople); Navigate(SuccessEmailAlaCarte, ScreenTransition.Fade)

 

2023-09-01_8-23-43.jpg

Categories:
I have the same question (0)
  • MarkRahn Profile Picture
    1,229 Super User 2025 Season 2 on at

    Hi @ShondaT ,

    If you need it to be empty every time the form is open, you could try setting the "Attach" control's Items property to:

    Blank()

     

    If that does not work, take a look at this post:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Possible-to-clear-attachments-when-editing-a-form/td-p/648621

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ShondaT Profile Picture
    228 on at

    @MarkBandR thank you for your response. Adding Blank() to the control's Items property didn't appear to work. I went to the link you provided and needed to ask the following question:

    @v-yutliu-msft how would I get this to work so that my user doesn't have to push a button on the form. I have a navigation button on another screen that navigates to the email template which I copied the attachment card to. If there is code that I could add to the button on the app's landing page that would remove the attachments that would be the best experience for my users. The current code on the button, a screenshot of the landing page, and a screenshot of the email screen are below:

     

    Navigate(EmailAlaCart, ScreenTransition.Fade)

     

    2023-09-05_11-42-02.jpg

     

    2023-09-01_8-23-43.jpg

  • Verified answer
    MarkRahn Profile Picture
    1,229 Super User 2025 Season 2 on at

    Hi @ShondaT 

     

    I just tested the following and it worked for me. Please put the following code in your button from the Landing screen right before the Navigate:

     

    Set(varResetAttach,true);
    Set(varResetAttach,false);

     

    For your Attachment control, find the "Reset" Property.

    Set it to:

    varResetAttach

     

    Flipping this variable to true then false will cause the Reset Event to fire.

     

    -Mark

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ShondaT Profile Picture
    228 on at

    @MarkBandR You are marvelous! That worked. I was just trying the Reset property but I only go so far as changing it from false to true and that wasn't working! I appreciate you! Have a wonderful day! 🙂

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard