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 / Button dissapearing af...
Power Apps
Answered

Button dissapearing after clicking on my own will

(0) ShareShare
ReportReport
Posted on by 312

Hello,

 

I am trying to do a survey, and what i want was, after they click the start, the button would dissapear on their cellphone, so they won't take the servey again! The problem is i don't know the code, and also, i didn't want to subject them by giving their name since this is an anonymous survey!

 

 

Any help would be appreciated

 

Fields

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    From your explanation I understand you want to hide a button after it has been clicked? 

    For that you can use the Visible property with context variables.

     

    On the OnSelect event of the button beside the function you already have, add UpdateContext({hideButton: true}) - hideButton being the context variable.

    Then set the Visible property of the button to hideButton.

     

    Or do you want the app to completely disappear from their phone once they have submitted an answer to the survey? If that's the case, then I don't know how to help you.

     

    Hope this helps 🙂 

  • Fields Profile Picture
    312 on at

    Hi @Anonymous,

     

    I have tried to do what you said, but it did not work, please keep in mind that i am very new at the PowerApp, so problably i missed something here!

    What i want to do is, they clicked the "Start" Button, they do the survey, and then, when they submit to go to the main menu, exactly the same expect the "Start" Button not showing, or atleast not fuctioning

    If possible, the button gone missing forever, but i would be ok, if the button dissapear on that only usage

     

    Awaiting Answer

     

    EDIT: Hi, so i was able to make the change, but the button or completely dissapears, or doesn't do anything

    Per example if i change hidebutton for HideButton2, it does nothing (Atleast on my own point of view as the owner), and if i but only button2 instead of HideButton, it will completely Dissapear (Like i said, only on my own point of view), is it normal? Or did i  did something wrong here?

     

    Awaiting answer

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

     

    Oh yeah you are right, the button completely disappears, sorry I didn't test it properly yesterday.

    However I do not know how to help you to make it completely disappears for a user, even when they open the app again. If I were to do it, I would implement some logic to keep track if the current user has submitted a survey (maybe give them random IDs or something).

     

    Maybe someone else will be able to help you with that.

    I will though explain how to make the button disappear for the current session, but bear in mind that the button will be visible again when they re-open the app (all the context variables values resetting).

     

    Leave the 'Start' button OnSelect property as it used to be, without the UpdateContext, and modify the OnSelect property of the 'Submit' button. Since when that button is pressed it navigates back to the first page, I assume you have a Navigate function in it, so on that Navigate you need to modify it to pass a context variable back to the first screen:

    Navigate(Screen1, ScreenTransition.Cover, {formSubmited: true})

    - where formSubmitted is the context variable

     

    Now on the first page on the 'Start' button Visible property use this:

    If(formSubmited, false, true)

    - which is going to hide the button when the formSubmitted is true, otherwise will show it

     

     

    Maybe this will help you in another scenario, and I hope that someone else knows how to make the button completely disappear. I would be curious myself to find out how to do it 🙂 

     

    Sorry I wan't of a more help.

     

    Thanks,

  • Fields Profile Picture
    312 on at

    Hey @Anonymous,

     

    That Actually Works, Thank you very much, Altough isn't what i really wanted it, You actually led me a great step into it, and i thank you very much for it!

     

    It works perfectly, there is nothing wrong with it!

     

    Once again, I thank you very much

     

    Fields,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    I'm glad it helps 🙂
  • Fields Profile Picture
    312 on at

    @Anonymous
    Actually, i am  sorry for this :(, but the form doesn't submit now...

    It goes directly to the mainscreen, but doesn't submit the form...

     

    Fields

     

    EDIT: Nevermind, it was my mistake! It's all good ^^

     

     

  • Fields Profile Picture
    312 on at

    Hey @Anonymous,

     

    Do you have any ideia on how to make a button completely dissapears... I have searching rough on this subject, and still can't find this...

     

    Any response would be appreciated!

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Fields,

     

    Honestly I don't know how to completely make it disappear. From my experience, every time you open an app all variables get reset and I don't know a way to persist them.

    The only workaround I could think of is to use some sort of identification (maybe under the form of ID) - assign an ID to a user and  when that user opens the app again check if a reply has already been submitted from that ID and show/hide the button. Not sure if that fits your case, but that's my only idea.

     

    Maybe someone else will be able to help.

     

    Thanks,

  • Fields Profile Picture
    312 on at

    Hi @Anonymous,

     

    That's basically the closes that i can get... And i would do that, but since this is "anonymous", i don't wanna go give them ID, so people know who is who, unless it's random, and i would got no ideia to indentifie who is who, then i would ask how do you do that!

    Anyway, i your previous ideia still works perfectly so...

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Fields, having them anonymous is indeed a bit of a pain.

    Maybe you have 2 buttons on the first page - one to login using an ID and one to generate a random ID for when they first open the app and show them a message with the ID and say they need to remember it - and you store it in a list with no other info about it - then when they open the app the second time they can use the ID to log in and you can use it to check if they've submitted something. 

     

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
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard