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 / Data refresh problems
Power Apps
Unanswered

Data refresh problems

(0) ShareShare
ReportReport
Posted on by 32

Hey there,

I've been customising the form for a SP list - a mistake in hindsight, but you live and learn - and it's quite complicated. After some help from this forum a few weeks ago i've got submitting all the forms across multiple screens working using a variable and a master form.

However, once I submit an item, if I go and reopen it then it shows old data - either the last item I had open before that or blank data. If I close it, then reopen it again then it pops up with right information, same as if I refresh the page then open something.

 

Bit of googling took me to https://powerusers.microsoft.com/t5/Building-Power-Apps/Power-Apps-Custom-Forms-not-refreshing-on-edit/td-p/297065 and https://powerusers.microsoft.com/t5/Building-Power-Apps/PowerApp-form-editing-problem-with-refresh/m-p/320508#M92171 , both of which mention using the Refresh() command. I've tried that in a few different places - on the OnSuccess of the 'master form', on the OnSuccess of a couple of the other forms and in the OnSave/OnEdit/OnView of SharePointIntegration but none of them seem to work.

 

Anyone got any advice and how to get the list form to show the correct data?

Thanks 🙂

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Geosharp 

    At first guess, you are most likely using a variable on the Item property of the form.  If so, then it is that variable that needs to be updated.  Avoid using Refresh as it is only going to needlessly slow down your app.

     

    What is the Item property of your form and how is it getting set?

     

  • Geosharp Profile Picture
    32 on at

    Hey there,

    I did wonder if it'd be you to reply again Randy - it was you who helped me out on the previous thread i'd made 🙂

    The item property for the master form is:

    Patch(glbCurrentItem, Form12.Updates, Form2.Updates, Form5.Updates, Form6.Updates, Form7.Updates, Form8.Updates, Form10.Updates, Form11.Updates, Form3.Updates, Form4.Updates, Form9.Updates)

     

    Yes, I know the form naming is terrible, something else i'll improve in version 2 😄

     

    I have tried doing refresh where I specify glbCurrentItem and the data connection name, and neither seem to work.

     

    Thanks 🙂

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Geosharp 

    Yes, since you are following the splitting forms properly video method from before, thought I would answer 😁

     

    What are you doing in the OnSuccess formula of the master form?  You should have a formula such as this in there:

       Set(glbCurrentItem, Self.LastSubmit)

     

  • Geosharp Profile Picture
    32 on at

    Hey there,

    Sorry, I meant to reply to this yesterday but got pulled off elsewhere.

    I've had a look, my OnSuccess looks nothing like that - currently it's just ResetForm(Form1); RequestHide()

     

    I assume I need to change it to be what you suggested?

    Cheers 🙂

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Geosharp 

    Yes, so you should change that formula to:

       Set(glbCurrentItem, Self.LastSubmit); ResetForm(Form1); RequestHide()

  • Geosharp Profile Picture
    32 on at

    Hey there,

    Thank you for clarifying that. It has made me realise though that I may have not provided complete information - considering how much I moan to staff about it I really should have known better! Not sure if this changes where the problem may be.....

     

    The problem of it showing old data happens all the time - even if I come to the list fresh and don't create a new item if I try and open anything it shows old data (if it's first time i've tried to open something it shows blank data, probably the defaults, otherwise it shows the previous item i'd opened), but if I close the form and click it again it updates to be right item.

     

    I have tried making those changes to the OnSuccess, they don't seem to have cured it. I'll post screenshots of my SharePoint Integration variables and the variables for the Master Form in a minute to provide a more complete picture.

     

    As i've been trying to gain an understanding of what's going on and the change you've suggested i've found mention of checking the .Selected.ID property of SharePointIntegration - I added a text box and set it to show that and that's pulling the correct record ID both times I open an item.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Geosharp 

    How are you setting glbCurrentItem?  That will be key to determining what you are seeing as your form(s) is based on it.

  • Geosharp Profile Picture
    32 on at

    Hey there,

    Attached are some screenshots of hopefully all the relevant properties. If i've understood what i'm doing, i'm setting glbCurrentItem using a Patch() command in the Item property of the master form.

    SharePointIntegration Properties.PNG
    Master Form Properties 1.PNG
    Master Form Properties 2.PNG
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Geosharp 

    Change the EditForm functions in all of the SharePointIntegration actions to ResetForm

    Your forms are already in Edit mode, so there is no need to issue an EditForm function.  But, you will want to reset them to the newly changed/selected record from the SharePoint list.

    RandyHayes_0-1619650008741.png

     

    Also, in regard to the OnView and ViewForm function, make sure that the Form mode properties of all of your forms are set to Form12.Mode

  • Geosharp Profile Picture
    32 on at

    Hey there,

    Thanks for that - shouldn't all my all other forms be set to <Master Form>.Mode? I thought that's what it should be from your video guide on multi form submission - though I have realised I never stated which one was the master form.

    Form1 is the Master Form. I've got all the other forms mode set to Form1.Mode. Thinking that i've got confused at some point, as when I thought about it more it seemed wrong, I changed the ResetForm()'s in OnNew, OnEdit and OnView to Form1 rather than Form12.

     

    View still isnt working, shows old data. However, i'd not thought to check this before, but if I click Edit All then is *does* show the right data, so it's just View thats broken.

     

    I've found mentioned here - https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-form - that ResetForm() doesn't work on a form when it's in View Mode, could this be affecting it? I'm not quite sure at which point OnView fires.

     

    Cheers 🙂

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard