Forum Discussion

zlasek's avatar
zlasek
Copper Contributor
Jul 17, 2023

PowerApps: Using Buttons to Update Existing Records

Hello,   I am trying to use buttons to populate my "ApprovalDecision" column instead of having the user type in "yes" or "no". I am new to PowerApps so I am unsure how to do this. This screenshot s...
  • SvenSieverding's avatar
    Jul 18, 2023

    Hi zlasek 

     

    you already have a form "Form1" with the "ApprovalDecisionDatacard1"


    Select that card and select "Unlock to change properties" on the right side

     

    The create a new Button "Approve" and set it's OnSelect Property to 

     

    Set(varApprovalResult,"Yes")

     

    and another Button "Reject" and set it's OnSelect Property to 

     

    Set(varApprovalResult,"No")

     


    Then select the ApprovalDecisionDatacard1 and set it's Default Property to "varApprovalResult"

    and the Property "Visible" to false


    This should be enough to fix your usecase.

    But you should also initialize the "varApprovalResult" variable in the "On Visible" property of your screen "Details" like

    Set(varApprovalResult,BrowseGallery1.Selected.ApprovalDecision)

    and enable/disable your "Approve"/"Deny" buttons by using this formula in their "DisplayMode " properties

     

    If(varApprovalResult="Yes",DisplayMode.Edit,DisplayMode.Disabled)


    Best Regards,
    Sven



     

Resources