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 / The send button only b...
Power Apps
Answered

The send button only becomes active after the save button has been selected

(0) ShareShare
ReportReport
Posted on by 202

Hi All 

I have a requirement for my users to send attachments to their Email directly from power apps with attachments on the email.

  • For this to work correctly I save the attachment using the formula on that very same screen Submit Form('Vehicle attachment Form');If('Vehicle attachment Form'.Error Kind=ErrorKind.None,Navigate('Vehicle Incidents Attachments',ScreenTransition.None)).
  • after the attachments are saved and I can view them I send an email to the user email address (user().Email) .To send I use the formula SubmitForm('Vehicle attachment Form');If('Vehicle attachment Form'.ErrorKind=ErrorKind.None,Navigate('Attach vehicle incidents',ScreenTransition.None));Office365Outlook.SendEmailV2(TextInput1_4.Text,TextInput2_1.Text,TextInput3_1.Text,{Attachments:AddColumns(RenameColumns(AttachmentControl.Attachments,"Value","ContentBytes"),"@odata.type","") });Reset(TextInput2_1);Reset(TextInput3_1)

Please note I could have made this one formula but sometimes it was sending the email without the attachments which is why I have done it this way .

What I need help for is to make sure when I first Save the attachment the Send Email Button is greyed out it only becomes active once the user has saved the attachment and then it allows user to click the send button and then send the attachment.

 

Email Attachments_1.PNG

 

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @rmaziwis ,

    Do you want to active "Send" button only after you submit your form data successfully?

     

    Based on the needs that you mentioned, I think a collection table variable could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

    Set the OnSelect property of the "Save" button to following:

     

    SubmitForm('Vehicle attachment Form');
    If(
     'Vehicle attachment Form'.ErrorKind=ErrorKind.None,
     Navigate('Attach vehicle incidents',ScreenTransition.None)
    )

     

    Set the OnSuccess property of the 'Vehicle attachment Form' to following:

     

    ClearCollect(AttachmentsCollection, 'Vehicle attachment Form'.LastSubmit.Attachments);

     

     

    Set the DisplayMode property of the "Send" button to following (If you do not attach attachments for the submitted record, this "Send" button would also be disabled) :

     

    If(
     !IsEmpty(AttachmentsCollection),
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    set the OnSelect property of the "Send" button to following:

     

    Office365Outlook.SendEmailV2(
     TextInput1_4.Text,
     TextInput2_1.Text,
     TextInput3_1.Text, 
     {
     Attachments: ForAll(
     RenameColumns(AttachmentsCollection, "Value", "Value1"),
     {
     Name: DisplayName, 
     ContentBytes: Value1, 
     '@odata.type': ""
     }
     )
     }
    );
    Reset(TextInput2_1);Reset(TextInput3_1);
    Clear(AttachmentsCollection) // Clear the AttachmentsCollection table

     

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • rodzmaz81 Profile Picture
    202 on at

    @v-xida-msft  my apologies as I was still busy testing the solution ,this worked thanks. I appreciate your help

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard