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 PowerApps
Power Apps
Unanswered

Refresh Form PowerApps

(2) ShareShare
ReportReport
Posted on by 270

Hi,

I have a form with a Sharepoint list as the datasource.  I can open the form in edit mode and I can edit the data.  I then save it using SubmitForm(Formname);Refresh(datasource). Should I be using patch instead? Submitform is a lot simpler.

 

I can check my sharepoint list and the data is updated correctly.  My problem is that the form actually refreshes back to what the original data was.

 

If I close the powerapps tool and re-open it then the data displays with the edited correct data.  If I refresh the sharepoint page it is embedded in it will show the correct data.

 

Can anyone tell me why the Refresh(datasource) is not updating it real time and I need to shut it down and re-open it?

Categories:
I have the same question (0)
  • paul_culmsee Profile Picture
    212 on at

    SubmitForm is indeed easier, but as soon as you need to do something more complex (eg break your form over multiple screens), you are better off moving to Patch. 

     

    As for your Refresh issue, I am not 100% sure. I wonder if the commands are running synchronously and therefore Refresh is happening prior to the commit to SharePoint? (I am happy to stand corrected by anyone else as I have not tested the theory)

     

    Paul

  • Gargoolgala Profile Picture
    270 on at

    Thanks Paul,

     

    I decided to add a "Refresh" button which is only the Refresh(datasource) OnSelect.  When I press the button the issue is the same - nothing updates to match the backend Sharepoint List. 

     

    Even waiting a few hours it still did not update unless I closed PowerApps and opened again. I also tried going to View -> Data sources and refreshing manually - same problem.

  • paul_culmsee Profile Picture
    212 on at

    Hi

     

    I am curious... If you add a gallery and set its items property to the data source, does the refresh button work then?

     

    Interested to see if its the datasource or the editform

     

    Paul

  • Gargoolgala Profile Picture
    270 on at

    Paul,

     

    so I added a gallery in next to the form and made updates to the form data. I hit Save which submits form and refreshes.

     

    The gallery updates nicely - the form reverts to original data. My next step I think will be to remove the form and build the "form" manually and use a Patch command to update the Sharepoint list.

     

    I really wish Powerapps was not so "immature" - I have been playing for a couple of weeks now and I am finding many limitations that are in "Planning" yet no way to know when Powerapps will truly be ready to be a Power User tool. 

  • paul_culmsee Profile Picture
    212 on at

    I feel your frustration, but I can assure you it has a lot going for it. For example consider this...

     

    https://www.youtube.com/watch?v=Hq7iqhEDCOI

     

    But in relation to your issue, I use the patch command with custom pages because of the additional control it affords. In fact you can see that in the example app referenced in the above video...

     

    regards

     

    Paul

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have the shame problem, anybody else know the answer? 

    Finally you make manually form?

     

    Regards

  • digvijayctex Profile Picture
    10 on at

    My situation was kind of different, on the OnSuccess of the form i was using

    RequestHide()

    but when i clicked to view the field again, the view form was not updated to current value, but the edit form was.

     

    I was able to solve this by adding 

    Refresh(DataSource)

    to the OnView of the SharePointIntegration before the ViewForm() command;

     

    Refresh(DataSource);ViewForm(Form);Navigate(ScreenView,ScreenTransition.Cover)

    Moreover,the Refresh button worked for me.

  • Daniela3 Profile Picture
    151 on at

    I had a hard time to clear data from a SharePoint form before opening form on another item from a SharePoint list.

             SharePointIntegration

                OnView

                            Refresh(Datasource);;ViewForm(SharePointForm)

    This saved my day.

    Thank you

    🙂

  • carlilelance Profile Picture
    353 on at

    One thing that always trips me up on these types of things is the Default and Update properties. The Default is what loads when the form loads. The Update is what goes into the data source when you submit the form. Usually if you use those two correctly, refreshes are unnecessary.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is an older thread, but I figured out a workaround to this issue.

    The way I got the sharepoint information to refresh without exiting the tool or anything, is by reassigning the value of the Item attribute. I'll explain by example, and hopefully it will be easy to understand, despite being a bit lengthy. [ I will surround any of the code I refer to with brackets { } ]

     

    So let's say I have a text label that displays a serial number called 'Serial Number lbl' where the 'Text' attribute of 'Serial Number lbl' is { ItemSelected.SerialNumber }

    I have a button called 'Edit Item btn' where the 'OnSelect' function contains { EditForm('Edit Item Details Form'); }

    My 'Edit Item Details Form' has an attribute 'Item' that contains the record I want to edit. So 'Item' is { ItemSelected }

    In my project, ItemSelected is a particular SharePoint record that is chosen from a list of items in a gallery control. So in that gallery, my OnSelect function is { ItemSelected = ThisItem } and that's where it is first assigned.

    Finally, I have another button 'Save btn' where the 'OnSelect' function is { SubmitForm('Edit Item Details Form'); }

     

    The way we can get the information to refresh is by modifying the 'OnSelect' function of our button 'Save btn' by adding two things:

    First, BEFORE we submit the form, we'll create a temporary variable that will clone our ItemSelected variable.

    We keep our SubmitForm() function the same.

    Then AFTER we submit the form, we'll reassign our ItemSelected variable.

     

    So then, our 'OnSelect' function of our button 'Save btn' will look like:

    { ItemSelected_temp = ItemSelected;

    SubmitForm('Edit Details Form');

    Set(ItemSelected, [the original record]);

    }

     

    Now of course [the original record] is not the code you would use. It depends how you initially assigned the variable 'ItemSelected' in the first place.

    As I said before, in my project, ItemSelected is a particular SharePoint record that is chosen from a list of items in a gallery control. So in that gallery, my OnSelect function is { ItemSelected = ThisItem } and that's where it is first assigned.

     

    To have our data refresh, we have to reassign this variable. I had to reassign it by looking up the record in the sharepoint list directly and to do that, I needed to use its own attributes. However, powerapps wouldn't let me assign the variable ItemSelected by using its own attributes:

    Non-functional code: { Set(ItemSelected, First(Filter('Datasource', 'Attribute 1' = ItemSelected.'Attribute 1', 'Attribute 2' = ItemSelected.'Attribute 2'))); }

     

    However, when I used a temporary variable to clone the original item and use the temporary variable's attributes, the code worked and the label refreshed in real time without any exiting or refreshing.

     

    Working code: { Set(ItemSelected, First(Filter('Datasource', 'Attribute 1' = ItemSelected_temp.'Attribute 1', 'Attribute 2' = ItemSelected_temp.'Attribute 2'))); }

     

    Hope this helps someone out!

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

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard