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 Apps
Answered

Variable

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

Im trying to imply a condition where once the button is pressed, it will not patch again the data. but the button is not giving the desirable results.

the result which i want is:

when the check in is pressed it will patch the data and change the showbutton to false so the user cannot patch the data again.

or pls help me if i can do this in another way.

global variable set on onstartglobal variable set on onstartonselect property of button where im implying this condition.onselect property of button where im implying this condition.

Categories:
I have the same question (0)
  • Verified answer
    LuizVicente Profile Picture
    984 Super User 2024 Season 1 on at

    I found it strange that you are using the Set and UpdateContext function to update the same variable. It remains to be seen how you are doing with the Button's Display mode property. If the variables are used through the app, use Set, otherwise use UpdateContext. Then, in the Display Mode property of the Button, check the value of the variable, if it is true, then display mode will be disabled, otherwise, edit.

    Like this:

    In my example I'm using global variable, so in App.OnStart:

    Set(checkin_pressed, false)

     

    btnCheckIn.OnSelect:

    Roverandom_0-1663722090938.png

    btnCheckIn.DisplayMode:

    Roverandom_1-1663722136449.png

     

    btnCheckOut.OnSelect:

    Roverandom_2-1663722216548.png

    btnCheckOut.DisplayMode:

    Roverandom_3-1663722249320.png

     

    Result:

    checkinbtn.gif

     

    There are other ways but I believe this can put you on the right path.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    So you are saying i should only use Set() throughout my app?

    And im making my buttons visible and invisible by use of it.

    And i also want my app to remember the last button i pressed because when i close it, it resets even if i pressed only checkin before closing it and next time when i start my app it shows checkin visible and checkout invisible.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard