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 / Retain Exit Settings f...
Power Apps
Unanswered

Retain Exit Settings for Next OnStart

(0) ShareShare
ReportReport
Posted on by 5,325 Super User 2025 Season 2

I have a main screen that has a series of buttons that allow for users to navigate through the app.

 

I have a toggle (Toggle1). I use the toggle to shutdown access to the site through the buttons referenced above.

 

The default setting of Toggle1 is 'true'. If for some reason the owner wants to limit access to the site for a period of time the owner can set Toggle1 to 'true' and all of the site buttons will default to 'Disabled'.

 

My issue, if the owner sets Toggle1 to off and then exits the site, when the owner returns the Toggle has reset to 'false' and all the button are back to 'Edit'.

 

How do I set it up so that the setting of Toggle1 is how the site open during the next viewing?

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    There are a couple of ways to handle this:

    1. Save those settings to a backend, such as a Sharepoint list. Read them back in during OnStart
    2. If you are using mobile apps only, you can save a collection for use at a future time using the Savedata and Loaddata functions. This functionality doesn't work for web browsers, though.

    Hope that helps,

    Bryan

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    Thank you for your reply.

     

    Yep, while I was typing the question it came to me to simply make a List, Patch to the List on Toggle1 change, then pull it back in through a Collection at OnStart, and set the Toggle1 default to Self...something, is that about right?🤔

  • BCLS776 Profile Picture
    8,994 Moderator on at

    The details will vary a bit depending on the exact needs of your app, but you've the basics. Personally, I prefer to use a Lookup rather than load the settings back into a collection. 

     

    Bryan

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    It is my understanidng that you can't query Lookup columns in Power Apps? Or, is that calculate columns?

     

    Please do tell; how can I solve this kunundrum?

  • BCLS776 Profile Picture
    8,994 Moderator on at

    Sorry, I wasn't clear. I don't use a lookup column; I use a LookUp() function to pull the desired values back out of a SharePoint list.

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    If you have an example can you share.

     

    I am not understanding how a many to one relationship work in a Lookup() function.

     

    Again, there may be one or may items associated with one Location on the 'List1'.

     

    That same location only appears once on 'List2'.

     

    If any one item in the table from the 'List1' in "Noncompliant" then that same location on 'List2' needs to be set to "Noncompliant".

     

  • BCLS776 Profile Picture
    8,994 Moderator on at

    I have an example for you using a Sharepoint list. These columns get set through a Patch as necessary. This one uses the User().Email as a unique ID for lookups:

     

    BCLS776_0-1631240845503.png

    In the OnStart of the app that uses this table, I have a few simple lookups to set some variables in the app:

    Set(varVisible, LookUp(UserSettings, AppUserName = User().Email).varVisible);
    Set(dispToggle, LookUp(UserSettings, AppUserName = User().Email).dispToggle);
    Set(defaultLocation, LookUp(UserSettings, AppUserName = User().Email).defaultLocation);

    Bryan

     

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    I'm using a flow.

     

    This looks like you are doing everything in Power Apps, is that correct?

     

    If you are using a flow how would I make this happen in a flow?

  • BCLS776 Profile Picture
    8,994 Moderator on at

    You started this thread asking about doing this with an app, but now you want to use a flow? That's puzzling - are you confusing this with another thread?

     

    I wouldn't use a flow to accomplish the task you originally described.

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    I didn't mean to confuse things.

     

    I have visual concept clarity issues.

     

    It takes my time to see some things.

     

    The table I referenced was created in a flow, for another pupose - you are correct I apologize.

         

    Set(varVisible, LookUp(UserSettings, AppUserName = User().Email).varVisible);
    Set(dispToggle, LookUp(UserSettings, AppUserName = User().Email).dispToggle);
    Set(defaultLocation, LookUp(UserSettings, AppUserName = User().Email).defaultLocation);

     

    Merely placing the above n the OnStart is going to force Toggle1 to default to the closed position when the app was last saved, yes? There is nothing else I need to do?

     

    I've made a few edits to match my fields. Should the below deliver the outcome I desire?

    Set(varVisible, LookUp(UserSettings, AppUserName = User().FullName).varVisible);

    Set(Toggle1, LookUp(UserSettings, AppUserName = User().FullName).Toggle1);

    Set(defaultLocation, LookUp(UserSettings, AppUserName = User().FullName).defaultLocation)

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard