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 a form not wor...
Power Apps
Unanswered

Refresh a form not working

(0) ShareShare
ReportReport
Posted on by 49

I have a form which "datasource" is a sharepoint list and "Item" is a varRecord (variable programmed as AllGallery.Selected).

The form is an edit form, however all components are set to DisplayMode.View except for one which is set to "Edit": Attachments. Under attachments I have a "Save" button which has this code under "OnSelect": 

 

Patch(
'Sharepoint_list_name';
LookUp('Sharepoint_list_name'; 'Column (ID)'=varRecord.ID);
Form1.Updates
);;
Notify("Saved";NotificationType.Success;2000)

 

This button works well and actually changes the attachments in existing record in my sharepoint list. But when I click it, the new added attachments still appear on the list as "Unsaved". They are in fact saved and if I come back to first screen and navigate to screen with my form/or just refresh the page, it will synchronize and display as saved. 

 

I wanted to add a Refresh icon in the top left corner, which a user can click and see if the attachments actually got saved or not. But adding the icon and putting "Refresh('Sharepoint_list_name')" doesn't work. Putting refresh into my "Save" button after "Notify" also doesn't work. 

 

Is there a way to do this? 

Categories:
I have the same question (0)
  • MudassarSZ365 Profile Picture
    591 on at

    Hi @MKPA ,

    Place this code on the on select Property of the Save Button

    Patch(
     'Sharepoint_list_name',
     LookUp('Sharepoint_list_name', 'Column (ID)' = varRecord.ID),
     Form1.Updates
    );
    Notify("Saved", NotificationType.Success, 2000);
    Refresh('Sharepoint_list_name'); // Refresh the SharePoint list to get the latest data
    ResetForm(Form1); // Reset the form to clear any unsaved data
    EditForm(Form1); // Switch the form back to edit mode if needed

    Place this the code on the onselect property of the refresh button

    Refresh('Sharepoint_list_name');
    ResetForm(Form1);
    EditForm(Form1); // Or ViewForm(Form1) if you want to switch back to view mode.

    Place this code on the Items property of the form

    Set(varRecord, LookUp('Sharepoint_list_name', 'Column (ID)' = varRecord.ID));

    If this solution is helpful to you, then please accept it. 😊

     

  • MKPA Profile Picture
    49 on at

    Error 

  • MKPA Profile Picture
    49 on at

    @MudassarSZ365 Unfortunately, this doesn't work. The save button now doesn't save my data and then just resets it to the way it was previously. 

     

    I'll give you an example: 
    I have 3 attachments. I delete one of them. I click "Save" and I can see the deleted attachment popping right back up. 

     

    I deleted the "reset form" part of the code on both save and refresh button and the result is the same as it worked before - save button saves the form, refresh button doesn't refresh it. 

  • MudassarSZ365 Profile Picture
    591 on at

    @MKPA ,

    for save button use this code 

    Patch(
     'Sharepoint_list_name',
     LookUp('Sharepoint_list_name', 'Column (ID)' = varRecord.ID),
     Form1.Updates
    );
    Notify("Saved", NotificationType.Success, 2000);
    Refresh('Sharepoint_list_name');

    for refresh button use this 

    Refresh('Sharepoint_list_name');

    on items property of the button use this code

    If(
     IsEmpty(varRecord), 
     Defaults('Sharepoint_list_name'), 
     LookUp('Sharepoint_list_name', 'Column (ID)' = varRecord.ID)
    )

     

     

  • MKPA Profile Picture
    49 on at

    @MudassarSZ365 

    Item property of a button? I don't have anything like this. 

    edit: I think you meant item property of a form. 

  • MudassarSZ365 Profile Picture
    591 on at

    @MKPA ,

    sorry items property of form

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard