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 / Show Dialog OnStart False
Power Apps
Answered

Show Dialog OnStart False

(0) ShareShare
ReportReport
Posted on by 7

In my app, I have a trash can 'dialog' inside of my gallery. 

trashIcon.PNG

When clicked on, the user has the option to delete the selected item out of the gallery.

showCheck.PNGtrashChecked.PNG

The problem I'm having- when my app is launched, the dialog is already selected.  I want the dialog to appear only when the user clicks on it.  The trash can is within my gallery which is on the very first page you see when you open the app. 

 

I have another dialog on a different screen, but that one always works.  It only appears when the user clicks on it.

 

I have tried an OnStart Set() but it does not work.

onStart.PNG

 

Let me know how I can open my app and not have the trash can icon already selected! Thanks

Categories:
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    delete the Set() in the onstart, this is a context variable and it can only be set using updatecontext on the page it is called upon (alternatively you can change the updatecontext code to Set(showCheck, true) )

     

    after removing that from onstart goto onvisible of your screen it is being used and place

    UpdateContext({showCheck:false})

    in the screens onvisible propert

     

  • mmollet Profile Picture
    3,187 on at

    So if you are setting the visability of these like this, and they are on the first (home) page of the app, then unless you actually run the app the onvisible property will never be ran b/c the screen is always visable and never triggers that property. Have you tried running the app from your phone or another browser not in edit mode to see how it performs? 

     

    If that wasnt the issue, try the following:

    Set your onVisable for that screen to: UpdateContext({showDialog: false});

    Set your onSelect for the trash icon to: UpdateContext({showDialog: true});

    Set your visible properties to both the check and the 'X' icon to: showDialog

    Set your onSelect for the check icon to: your 'delete' code for whatever you are trying to delete followed by UpdateContext({showDialog: false});

    Set your onSelect for the 'X' icon to: UpdateContext({showDialog: false});

     

    Make sure you have ; in between lines of code whenever you are trying to do more than one thing like I mentioned above for the check icon code.

     

    Hope this helps! If this is the solution for your issue please mark this as the solution for others to find it more easily.

  • TheRobRush Profile Picture
    11,128 Moderator on at

    OnVisible for first screen fires as soon as the app is opened, the issue was he set a context variable in the onstart which is not part of the screen he was using his variable on. Context variable have to be called on the screen they are being used, unless being passed into that screen via the Navigate() function

  • usermaylee Profile Picture
    7 on at

    I took the set function out and no luck.  When I launch the app from a browser, the trash can dialog is selected automatically.

     

    The trash icon has the OnSelect property:

    UpdateContext({showCheck:true})

     

    The Cancel icon has the OnSelect property: 

    UpdateContext({showCheck:false})

    I am able to delete items from my gallery and the icons do everything they are supposed to, but when the app is launched, the trash can icon is already selected.  Hopefully this all makes sense.

  • TheRobRush Profile Picture
    11,128 Moderator on at

    did you add the onvisible property to the screen that I supplied in my first reponse

  • usermaylee Profile Picture
    7 on at

    Setting the screen's OnVisible to 

     

    UpdateContext({showCheck:false})

     

    fixed my problem.  Thank you!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard