cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
skylitedave
Level 10

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
bolin-stratus
Level: Powered On

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

I just solved this issue by adding this line to the EditDetails screen's OnVisible property:

Refresh('SP List Name')

View solution in original post

14 REPLIES 14
Super User
Super User

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

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?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
skylitedave
Level 10

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

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

 

Anonymous
Not applicable

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

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.

Highlighted
skylitedave
Level 10

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

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

 

Smiley Happy

 

 

Anonymous
Not applicable

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

No such luck!
I had tried the same thing with my submit button and it didn’t work, either.
GawieBing
Level: Powered On

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

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
Level 8

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

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
Level 8

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

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!

Anonymous
Not applicable

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

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!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 303 members 1,923 guests
Please welcome our newest community members: