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 / Save form without leav...
Power Apps
Unanswered

Save form without leaving OR patch onchange without refreshing

(0) ShareShare
ReportReport
Posted on by 39

Hello, new Powerapps user here trying to build my first app, it seems perfect for our uses but I can't get past this one issue.

 

I have a form I'm building that will have a lot of data cards. My users are uncomfortable with the idea of only clicking "save" at the end after spending over an hour filling out the form with a client. I have done a lot of searching and can't find any solution to my issue.

 

My data comes from the database partially filled out, and then we will use this form to update anything that is entered incorrectly, and add a lot of new information. 

 

I have a save button set to : UpdateContext({FormDisabled: true}); SubmitForm(Form1);UpdateContext({FormDisabled: false})

 

this works, but when the form is enabled again, all of the fields are reset to the information they contained when the page was first opened from the gallery. The database is updated correctly, but seeing all of that information disappear will terrify the users. Clicking back, waiting a few seconds, and then selecting the item again will present the correct data. 

 

I have tried running patch inside of a textbox on change, so that it would save as they go. my code works, but again, once the patch is complete, the textbox displays the original content. 

 

patch code: Patch('[dbo].[Opportunity]',First(Filter('[dbo].[Opportunity]',AccountId=displayItem.AccountId)),{Convert_Street__c:Convert_Street__c})

 

I even tried having the save button incorporate a Back command, and then a Navigate command back to the current item, but that doesn't work. you can see the blue dots doing their work across the top. if the navigate command fires before powerapps refreshes the dataset, it gets the old set of data. 

 

help!

 

I am connected via the "cloud services" option to an on-premises SQL server.

 

I am ok with having the "Save" command display a spinning wheel or and waiting until the DB refresh is complete, if that's possible. 

 

I was thinking maybe when the patch runs, on each textbox, I could patch the data to a variable in memory, then patch to the DB, and then pull the data back to the textbox from the variable. But I can't figure out how to do that. 

 

I'm also ok with Save running on a timer / "Autosave" and just having it quietly save the data in the background without affecting what the user sees on screen. This would be ideal. I could set the SubmitForm to run on a timer, but again, the screen would refresh and show the user the original set of data. 

Categories:
I have the same question (0)
  • grodinsm Profile Picture
    39 on at

    Update: For anyone who ever has this issue and couldn't find a solution, hopefully you find this thread. 

     

    I did not have this app auto-generated for me, because I plan on using it mostly on a desktop and needed a 3 column design. I created the form first, and then manually made the gallery later. 

     

    The form was generated for me with an Item property of "displayItem" however if you follow along with the powerapps tutorials it suggests that it should be set to the galleryname.selected (in my case TemplateGalleryList1.selected)

     

    After doing this, submitForm works, the screen shows the old data for a second or two, but then the fields show the correct, new data after a few seconds. 

     

    The Code above I listed for Patch does not play nicely with this change, as it still references displayitem.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard