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 / Resume App session wit...
Power Apps
Unanswered

Resume App session with all controls still filled out from previous session

(0) ShareShare
ReportReport
Posted on by 235

Hey everyone,

 

I am updating an app that I did not create. But some of the users say if they put their phone in their pocket for like 15 min and then try to continue where they left off it kicks them out.

Is it possible to save user control inputs, so that if that happens they can "resume" where they left off?

This is a canvas app that does not use a form control. 

 

Categories:
I have the same question (0)
  • Verified answer
    mmollet Profile Picture
    3,187 on at

    Only way I can think to do that is as follows: (will be a pain depending on number of controls you have)

    • For this example I will have 1 screen with 3 controls but you can scale it to whatever size you need. 
      • Control 1: TextInput that holds user input of type string
      • Control 2: TextInput that holds user input of type int
      • Control 3: Dropdown menu that hold user input of type string
    • I will also use a SP list named Controls for this example with your users each getting their own row in the list. This will be used to look up the saved values for each control when they want to reopen the app. The columns in this list will need to include the user name/user email and a place to store each control value.
      • Col1: UserName - string (single line of text)
      • Col2: Control1 - string (single line of text) (i would make a better name depending on what the control is called or what it is storing)
      • Col3: Control2 - string (single line of text) (i would make a better name depending on what the control is called or what it is storing)
      • Col4: Control3 - string (single line of text) (i would make a better name depending on what the control is called or what it is storing)
    • This will utilize a timer to 'auto-save' every x number of miliseconds I will be using 10000 for 10 sec since you said 15 sec is an issue for sure.
    • My SP list will store the User().FullName or User().Email doesnt matter which. I will use User().FullName

    The idea here is to have the timer execute a patch function that saves all current control values to a SP list that will be used to repopulate the controls. The repopulation is where the pain in the ass will come in. The patch statement could be something like: 

    OnTimerEnd: Patch(Controls, {UserName: User().FullName, Control1: Control1.Text, Control2: Control2.Text, Control3: Control3.Selected.Value})

    This timer will execute this patch every 10 seconds and will find the current user in the new list and will save the current input for each control to its respective column for access later when the user is ready to start again.

     

    Now for the fun part 😅

     

    Each of the controls will need AT LEAST this to be done to them on top of what they already do. Be careful about how this is done as this could introduce bugs if the logic is changed in even slight ways. I would reccomend making sure you have a version that you know you can revert back to before changing the following if not before doing any of this. 

     

    OnStart for app: Set(userSaveState, Lookup(Controls, UserName = User().FullName))

    Now we have the row for that user and all of their saved control values.

    For each control you will need something like the following:

    Control1.Text - (this was a TextInput of type string): If(IsBlank(userSaveState.Control1), do normal stuff, userSaveState.Control1)

    What we are doing here is checking if the save state has a value for that control. If it does not have a value saved then you let whatever was happening before happen (this could be nothing), but if there is a value saved for that control we want to display it. This will need to be done for literally every control in the app that you want to save. What should result is an auto-loading save state for the user based on the last auto-save that was executed by the timer. 

     

    The last step would be to figure out when you want to clear the user's save state in the SP list. For example if you have a form that you are trying to do this with and your user submits the form, this would be a good time to clear the save state data from their sharepoint row as you can assume that it is no longer needed since it was uploaded. This could be done by doing:

    Patch(Controls, UserName = User().FullName, {Control1: Blank(), Control2:Blank(), Control3:Blank()})

    **Make sure you dont erase the UserName column as that would make none of this work. only do the columns that hold control values for the save state

     

    Once this is done update me on how its going. I have done very similar things to this before but this is just all off the top of my head so maybe try this first and see how far it gets you. Might even build a quick app that just submits an item from a simple form and test the functionality using that before messing with the real data. 

     

    Im sure this was TMI but I hope it helps!

  • Charliemacdmv Profile Picture
    235 on at

    @mmollet First thank you very much for that detailed explanation. I don't know why I didn't think about the timer. This is def a good start. I will start to work on this. It will take some time as I have about 25 controls. Yikes.

  • mmollet Profile Picture
    3,187 on at

    Holy 🦆! xD well good luck and I hope it works out for 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard