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 / Button to send an emai...
Power Apps
Unanswered

Button to send an email and update excel cell

(0) ShareShare
ReportReport
Posted on by 33

Hey all,

 

I'm looking to add a button to my app that sends an email and updates the current row that it is editing in an excel sheet.

 

I figured out how to send the email, but I am having issues with using the "Patch" command.

 

Pics:

 

Home ScreenHome Screen

 

View a rowView a row

 

Edit a rowEdit a row

 

The cell in excel I want to updateThe cell in excel I want to updateButton codeButton code

 

I've read through the patch command notes and I can't figure out how to use it to update the corresponding cell.

 

Any and all insight or hints are appreciated.

 

Thanks,

 

JT

 

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

    @DCGN2 

    You are pretty close.  The missing piece is in the 2nd argument of PATCH.  You need to indicate which record to change in your datasource.

    Please test this idea by using this code instead.  It will update EmailConfirmSent with the value "y" for Key=1.  You might need to put the 1 between double-quotes like Key="1" depending on whether its read as text or a number.

     

    Patch(IntoolsTracking, LookUp(IntoolsTracking, Key=1),{EmailConfirmSent: "y"})

     

    To make it possible to update EmailConfirmSent for whichever record is selected you would do something like this.  DataCardValue_Key refers to the text input displaying the number 1 on your second screen.

     

    Patch(
     IntoolsTracking,
     LookUp(IntoolsTracking,Key=Value(DataCardValue_Key.Text)),
     {EmailConfirmSent: "y"}
    )

     

    ---
    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."

  • DCGN2 Profile Picture
    33 on at

    @mdevaney 

     

     

    Patch(IntoolsTracking, Key="1",{EmailConfirmSent: "y"})

     

     

    When I input this code, I get this error:

     

    error.png

     
  • mdevaney Profile Picture
    29,989 Moderator on at

    @DCGN2 

    I have made some corrections to my original post.  The LookUp function was what I forgot in my original response.

  • DCGN2 Profile Picture
    33 on at

    @mdevaney 

     

    Cool, I was able to get the code to work for filling in a specific cell with the code.

     

    However, as you mentioned, I want to be able to edit it for the current record that is showing.

     

    When I input the code you gave me it gives me an error about "Name isn't valid. This identifier isn't recognized" and that "Value has invalid arguments".

     

    When I start to type DataCardValue... I get the below for suggestions.

     

    error 2.png

     

    Thanks,

     

    JT

  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @DCGN2

    You will need to replace DataCardValue_Key.Text with the real name from your app. 

     

    Click on the item highlighted in Red below and put its name there instead.  Make sure you use ."Text" instead of ".text" too.

     

     

    sss.png

     

    ---
    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."

  • DCGN2 Profile Picture
    33 on at

    Thanks for your help! I'm pretty new to coding so your insight is much appreciated.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard