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 / Having issue with Powe...
Power Apps
Answered

Having issue with Powerapps

(0) ShareShare
ReportReport
Posted on by 6
Hi Community,
I am working on a Canvas App connected to a SharePoint list. I am using the Patch() function to update records from an Edit Form.
The record updates successfully in the SharePoint list, but the Gallery connected to the same list does not refresh immediately after the Patch() operation. Users need to manually refresh the app or navigate away and come back to see the updated data.
Current formula:
Patch(
    EmployeeRequests,
    LookUp(EmployeeRequests, ID = SelectedID),
    {
        Status: "Approved"
    }
);
I also tried using:
Refresh(EmployeeRequests)
after the Patch() function, but the gallery still sometimes shows old values.
Environment:
• Power Apps Canvas App
• SharePoint Online list as data source
• Gallery connected directly to the SharePoint list
Questions:
1. Is there a better way to force the gallery to refresh after Patch()?
2. Should I use collections instead of direct SharePoint connection?
3. Are there any delegation or caching limitations causing this behavior?
Any suggestions would be appreciated.
Thanks!
Categories:
I have the same question (0)
  • Suggested answer
    Vish WR Profile Picture
    3,748 on at
     

    This is a known SharePoint connector caching behaviour in Canvas Apps. Even though the Patch succeeds, the gallery holds onto stale data until the datasource is fully re-evaluated.First thing to try — add Reset(Gallery1) after your Refresh() call

    try — add Reset(Gallery1) after your Refresh() call:

    Patch(
        EmployeeRequests,
        LookUp(EmployeeRequests, ID = SelectedID),
        { Status: "Approved" }
    );
    Refresh(EmployeeRequests);
    Reset(Gallery1);
     

    Also, confirm your gallery Items property is pointing directly to EmployeeRequests and not to a filtered variable or old collection that isn't getting updated.

    If the inconsistency continues, switching to a local collection is the most reliable approach with SharePoint as a datasource:

    Patch(
        EmployeeRequests,
        LookUp(EmployeeRequests, ID = SelectedID),
        { Status: "Approved" }
    );
    Refresh(EmployeeRequests);
    ClearCollect(colRequests, EmployeeRequests);

     

    Then set your gallery Items to colRequests. The gallery now reads from memory instead of waiting on the SharePoint connector, so updates appear instantly every time.

    On your delegation question yes, SharePoint connector caching and delegation limits on large lists can contribute to this, especially if you have filters or sorts on the gallery. Using a collection sidesteps most of that.

    Vishnu WR
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 
  • Suggested answer
    11manish Profile Picture
    3,333 on at
    Your Patch() logic is correct.
     
    The issue is not the update itself — it is the way Power Apps handles SharePoint datasource caching and Gallery rendering.
     
    Refresh(EmployeeRequests) alone is often unreliable for immediate UI updates because:
    • SharePoint sync is asynchronous
    • the Gallery may still hold cached records
    Power Apps does not always instantly re-query the datasource.
     
    The most reliable and recommended pattern is:
    • SharePoint = backend storage
    • Collection = UI datasource
    • Patch both backend and collection together
     
    This is the standard production-grade approach for Canvas Apps using SharePoint.
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @CU23050719-3

    Using a collection alone may not solve the issue because the collection also reloads data from the same SharePoint list. If SharePoint or Power Apps is still returning cached data immediately after Patch(), the collection can also contain old values.

    Better approach is to update the gallery source locally after Patch.

    Patch(EmployeeRequests, 
        LookUp(EmployeeRequests, ID = SelectedID), 
         { 
            Status: "Approved" 
         } 
    );
    Refresh(EmployeeRequests);

    The issue is caused by Power Apps caching rather than SharePoint itself. Please try to login with different browser and try it.

    Also, display the items in descending order in the Gallery so you can easily verify whether the latest data is being shown or not.

     ---------------------------------------------------------------------------------
    📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.
    ✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.
    💛 A Like always motivates me to keep contributing!

  • Verified answer
    Nanit Khanna Profile Picture
    68 on at

    Hi,

    This is usually caused by SharePoint caching/sync delay in Canvas Apps.

    Recommended approach:
    • Use:

    Patch(...);
    Refresh(EmployeeRequests);
    Reset(Gallery1)

    • If using a form:

    SubmitForm(EditForm1);
    Refresh(EmployeeRequests)

    Best practices:
    • Collections can improve UI responsiveness for large lists
    • Avoid relying only on direct SharePoint refresh for instant UI updates
    • You can also update a local collection after Patch() for immediate gallery changes

    Example:

    Patch(...);
    Refresh(EmployeeRequests);
    ClearCollect(colRequests, EmployeeRequests)

    Yes, SharePoint connector caching and delegation behavior can sometimes delay gallery updates briefly after Patch().

  • Verified answer
    deepakmehta13a Profile Picture
    369 on at

    Hi,

    Patch() updates the SharePoint item correctly, but the Gallery may still show cached data for a short time.

    You can try this pattern:

    Patch(
        EmployeeRequests,
        LookUp(EmployeeRequests, ID = SelectedID),
        { Status: "Approved" }
    );
    
    Refresh(EmployeeRequests);
    Gallery1.Selected
    

    Other suggestions:
    • Rebind the Gallery Items property if using filters/sorting
    • Use a local collection for better real-time UI updates
    • Large SharePoint lists can sometimes delay refresh synchronization

    A common approach is:

    Refresh(EmployeeRequests);
    ClearCollect(colRequests, EmployeeRequests)
    

    Then bind the Gallery to colRequests instead of the SharePoint list directly.

     


     

    If this helps resolve your issue, please consider marking the response as Verified so it can help others facing a similar scenario. 

    If you found this helpful, you can also click “Yes” on “Was this reply helpful?” or give it a Like. 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard