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 / Refresh form data with...
Power Apps
Answered

Refresh form data with new data after submit without leaving the form

(4) ShareShare
ReportReport
Posted on by 652

Hi

 

I have a form on a canvas and I have a button on the screen that lets the user edit the data in the form ( changes the form mode from view to edit) .  Once the user is happy with the edits, they hit a button that has a Submit form in it and it changes the form mode back to Display. The data is stored in a SharePoint List.  

 

Here is the issue, the data saves fine to the SharePoint but does not appear  in the form unless I close the form and then return to it by selecting the screen that holds the form from a gallery.  I tried issuing a Refresh in the Save button but no luck.  I also tried Gallery.Selected from the save button on the screen holding the form.  Again no luck...

 

Is there a trick to get the data submitted to form to show up in the form without exiiting the form and then re-opening the form?

Categories:
I have the same question (0)
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    I am a little confused. If you made a change to the data that is being displayed on the form and submitted the form changes and never navigated off the form shouldn't you still be seeing the changes you made in the form. What formulas do you have firing when you save the form changes?

  • skylitedave Profile Picture
    652 on at

    Seems to be working now...  I will retract and will repost if I see it pop up again...

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am having the exact same problem -- I have a gallery which takes you to a view details screen which takes you to an edit screen. 

     

    When a user submits an edit via the edit mode of the form, we go back to the view page and the view form but the updates don't show up.

     

    If I go back to the gallery, the changes show up there. Then if I re-click on the details page, the changes show up as they were supposed to in the first place. 

     

    What gives? Can anybody help? This is driving me bonkers.

  • skylitedave Profile Picture
    652 on at

    Ahhhh....  This is a vexing issue for sure!

     

    Try putting in a Refresh(datasource)  in the OnSuccess Property of the edit form

     

    Let me know if this solves the issue

     

    🙂

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    No such luck!
    I had tried the same thing with my submit button and it didn’t work, either.
  • GawieBing Profile Picture
    6 on at

    I am having exactly the same problem:

     

    1. I select an item from a Gallery. This navigates to a view screen with a form in Display mode.
    2. From the view screen, I click on an Edit button that navigates me to an edit screen with the same form in Edit mode.
    3. I make a change on the form and press a Save button. This intiates a SubmitForm(formname);Back()
    4. I am now back at the view screen but my changes are not reflected.
    5. I navigate back to the Gallery and select the item again.  This navigates me to the view screen for the same item.
    6. On the view form, the changes are now represented on the form.

    I have added the Refresh(datasource) command to the OnSuccess property of the form and can see that the data is refreshing when I SubmitData but the view form is still not displaying the updated data.


    Does anyone have a solution to this yet?

  • PhilD Profile Picture
    1,011 on at

    I think I figured the root cause (at least in my case).

     

    I experienced the exact same thing, simple form > EditForm > make a change > SubmitForm > ViewForm ... new changes save to item but do not show on the form (now in view mode) unless I go back to the gallery and reinvoke the form.

     

    I set a variable when a gallery item was clicked and then used that variable in the form's Item property. Using the Gallery.Selected method instead of the variable made this work as expected. In other words I could submit form data and return to view mode and see the new/updated data in the form without refreshing or navigating away and back again.

     

    Before

    Gallery OnSelect property

    Navigate(scrRequestDetails,ScreenTransition.None);
    Set(varRequestDetailItem,GalleryRequests.Selected);
    ViewForm(FormIssue)

    Form's Item property

    varRequestDetailItem

    After

    Gallery OnSelect property

    Navigate(scrRequestDetails,ScreenTransition.None);
    ViewForm(FormIssue)

    Form's Item property

    GalleryRequests.Selected
  • PhilD Profile Picture
    1,011 on at

    Writing my last post made me determined to find another way...

     

    Turns out, you can use the variable method to assign the form's item and have this work if you put the sequence of commands in the form's submit button like shown below.

     

    Form's OnSubmit

    SubmitForm(FormIssue);
    Refresh(Ideas);
    Set(varRequestDetailItem,GalleryRequests.Selected);
    ViewForm(FormIssue)

    Without the Refresh it behaves the same as before but when you submit > refresh > set variable > view form it seems to work. Hope this helps!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Well, this is a weird saga. 

     

    Turns out, PhilD's solution worked for me (major kudos to you!). Removing the Set(Variable) in the gallery OnSelect fixed the whole thing.

     

    Here's the weird part: according to my notes, I didn't even have the variable in that initially. I added it in a few weeks ago because of a glitch -- presumably, the same glitch that I was trying to fix by adding the variable in the first place! 

    Not really sure what happened there, but I'm glad it is working now!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Another comment, since I have spent an inordinate amount of time on this and I'd like to spare future users the same trouble... 

     

    Phil, when I was working on this yesterday, I didn't quite understand your second solution so I just removed the global variable from my gallery OnSelect property and my edit form's Item property.

    Well, wouldn't you know I ran into another problem today where I really needed that global variable in place. 

    So, I came back to this. 

     

    Turns out Phil's second solution is even better than the first (so extra kudos to you)! 

    As usual, this most infuriating problem had a simple solution -- and the trick was just to find it. 

     

    For anybody who runs into this problem later...
    IF you are running into a problem where you submit a form but changes don't show up until you re-select the item from the gallery...
    AND you are using a global variable instead of the default Gallery.Selected method of choosing and editing gallery records...
    THEN the easy solution is to add a clause to your submit button, before the navigate property, wherein you update the value of the global variable (using SET). This basically elbows PowerApps and reminds it that when it goes back to the view screen, it should show you information from the updated global variable item. 

     

    Easy peasy. 

     

    For what it's worth, my solution was slightly different than what Phil wrote above. 

    Instead of Phil's suggestion:

    Set(Globalvariablename,Galleryname.Selected);

     

    I put: 

    Set(Globalvariablename,Editformname.LastSubmit);

     

    Seems to be working fine now. 

     

    Thanks for getting to this first, Phil!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 482 Most Valuable Professional

#2
11manish Profile Picture

11manish 459

#3
Haque Profile Picture

Haque 331

Last 30 days Overall leaderboard