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 email to the User...
Power Apps
Answered

Send email to the User what the user has just submitted in SharePoint List.

(0) ShareShare
ReportReport
Posted on by 709

Hello everyone,

 

I am struggling to get the Formula for the Button.

Ask- I want to press a button and email should trigger the desired recipient which is in the Inputbox.

I have galley called ProcessKnowledgeTestGallery when submitting the gallery data it's storing into SharePoint List named ProcessKnowledgeTest.

Now I want to assign a new button Email send. When Click it should send the current data which the user had just submitted from Gallery to Sharepoint List.

The email needs to send as an attachment.

 

Step by Step help is appreciated as I am new to Powerapps.

 

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @akbarmahfuzalam 
    I can show you how to send a message using the gallery data in the body of the email. Let me know if you want my help with.  I cannot do it as an attachment.

     

    If yes, please send a screenshot of your app so I can come up with some example code.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • akbarmahfuzalam Profile Picture
    709 on at

    Thanks for replying to my concern.

     

    Here we go with a screenshot .

     

    akbarmahfuzalam_0-1594984609719.png

     

    On my Submit Button

    akbarmahfuzalam_1-1594984677518.png

     

    Please let me know if you need any other info.

     

  • mdevaney Profile Picture
    29,991 Moderator on at

    @akbarmahfuzalam 
    You didn't answer my question.  I can't send as attachment.

  • akbarmahfuzalam Profile Picture
    709 on at

    No Problem,

    If I am able to showcase the user what they have just submitted in SP at that very moment and it can be sent as a body in the email as a table format. I am Good with that. Please go ahead with your solution what shall I put in the formula bar Onselect. 

    Eagerly waiting for your response.

     

  • akbarmahfuzalam Profile Picture
    709 on at

    Hey I answered you . 

  • akbarmahfuzalam Profile Picture
    709 on at

    Hey I answered you. I am okay if there is no attachment.

  • akbarmahfuzalam Profile Picture
    709 on at

    Is there someone else who can help me with the above mentioned subject. I would be highly obliged.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @akbarmahfuzalam 

    If you can forego the attachment and simply send as the body of the email, it would be much easier to start.

     

    All you need do is generate the HTML that will be the body and then perform a SendEmail on it.

    I'm not sure if you are stating that you want the email to be generated after submit, or if you want it to be its own separate button.

    Here is an example of it on it's own button (if you want it on the submit, then just add this to the end of your Submit formula).

    NOTE: This is shortened to be an example for you and only includes the first 4 columns of your Gallery - you can take the example and complete for the rest of your columns (please excuse any typos...doing this on the fly):

    With(
    {myEmailBody:
     "<html><head></head>
     <body>
     <p>Please note the follwing items were submitted by " & User().FullName & " on " & Now() & "</p>
     <table>
     <tr><th>Date</th><th>Week</th><th>Month</th><th>SAP</th></tr>" &
     
     Concat(ProcessKnowledgeTestGallery.AllItems,
     "<tr><td>" & PKTDate.SelectedDate & "</td>
     <td>" & PKTWeek.Text & "</td>
     <td>" & PKTMonth.Text & "</td>
     <td>" & SAPID.Text & "</td>
     </tr>"
     ) &
     "</body>
     </html>"
    },
    
    Office365Outlook.SendMail(yourTextInputControl.Text, 
     "Records submitted (or whatever Title you want)",
     myEmailBody,
     {IsHtml:true}
    )
    

     

     

  • akbarmahfuzalam Profile Picture
    709 on at

    Hey Randy,

     

    Thanks for your help. It really means a lot to me.

     

    the entire code

     

    With(
    {myEmailBody:
    "<html><head></head>
    <body>
    <p>Please note the follwing items were submitted by " & User().FullName & " on " & Now() & "</p>
    <table>
    <tr><th>Date</th><th>Week</th><th>Month</th><th>SAP</th><th>EID</th><th>LOB</th><th>QUEUE</th><th>OpportunityEarned</th><th>TotalOpportunity</th><th>UploadedBy</th></tr>" &

    Concat(ProcessKnowledgeTestGallery.AllItems,
    "<tr><td>" & PKTDate.Text & "</td>
    <td>" & PKTWeek.Text & "</td>
    <td>" & PKTMonth.Text & "</td>
    <td>" & SAPID.Text & "</td>
    <td>" & EID.Text & "</td>
    <td>" & LineOfBusiness.Text & "</td>
    <td>" & Queue.Text & "</td>
    <td>" & TextInputOpportunityEarned.Text & "</td>
    <td>" & TextInputTotalOpportunity.Text & "</td>
    <td>" & UploadeBY.Text & "</td>
    </tr>"
    ) &
    "</body>
    </html>"
    },

    Office365Outlook.SendEmailV2(TextInputEmail.Text,
    "Records submitted (or whatever Title you want)",
    myEmailBody,
    {IsHtml:true}
    )

     

    While incorporating the code which you have given to me. it works quite well until the " Office365Outlook.SendEmailV2(TextInputEmail.Text,
    "Records submitted (or whatever Title you want)",
    myEmailBody,
    {IsHtml:true}

     

    So there is an error on {IsHtml:true}

    No Parameter: This Funtion has no optional Parameter named 'IsHtml'

     

    akbarmahfuzalam_0-1595084774022.png

     

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @akbarmahfuzalam 

    Yep...as mentioned 

    please excuse any typos...doing this on the fly)

    Please add a ")" to the end of the entire formula:

    With(
    {myEmailBody:
     "<html><head></head>
     <body>
     <p>Please note the follwing items were submitted by " & User().FullName & " on " & Now() & "</p>
     <table>
     <tr><th>Date</th><th>Week</th><th>Month</th><th>SAP</th></tr>" &
     
     Concat(ProcessKnowledgeTestGallery.AllItems,
     "<tr><td>" & PKTDate.SelectedDate & "</td>
     <td>" & PKTWeek.Text & "</td>
     <td>" & PKTMonth.Text & "</td>
     <td>" & SAPID.Text & "</td>
     </tr>"
     ) &
     "</body>
     </html>"
    },
    
    Office365Outlook.SendMail(yourTextInputControl.Text, 
     "Records submitted (or whatever Title you want)",
     myEmailBody,
     {IsHtml:true}
    )
    )

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard