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 / Gallery patched text f...
Power Apps
Answered

Gallery patched text field only updating after changing screens

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

This is all based on data stored in a SharePoint list called: Test Checklist USA

The SharePoint list has about 130 lines each with 30 columns.

 

My app has a Gallery called: G1

In the gallery I have two text input fields: Task Owner and Comments. Both have data loaded by default from the SharePoint list.

 

When the user changes the Task Owner field in the app, I want to update the comments field to add information about the change and update the SharePoint with the information (new comment and new task owner) so I am using patch in the On Change property of the Task Owner field:

 

Patch('Test Checklist USA',ThisItem,{'Task owner (prefilled)_E':Taskowner.Text}); //patches the task owner in the sharepoint
Patch('Test Checklist USA',ThisItem,{Comments_E:ThisItem.Comments_E & Char(13) & User().FullName & " (" & Now() & "): Task Owner changed to: " & Taskowner.Text}) //patches the comment field in the sharepoint

 

When the change happens, the Task Owner is updated but the comment field stays the same. Only after navigating to a different screen and returning do I see the change to the Comment field.

 

I have tried to patch the Comment first and then the Task Owner like so:

 

Patch('Test Checklist USA',ThisItem,{Comments_E:ThisItem.Comments_E & Char(13) & User().FullName & " (" & Now() & "): Task Owner changed to: " & Taskowner.Text}); //patches the comment field in the sharepoint

Patch('Test Checklist USA',ThisItem,{'Task owner (prefilled)_E':Taskowner.Text}) //patches the task owner in the sharepoint

 

In this case, I can see the change to the comment field immediately, but the Task Owner field reverts to the previous value. Again, only after I navigating to a different screen and returning do I see the change to the Task Owner field.

 

I have tried refreshing the data source using Refresh('Test Checklist USA') after the code but it does nothing.

 

Is there anything I can do to force the second patched field to update with the new information without having to navigate to a different screen and come back?

Categories:
I have the same question (0)
  • Verified answer
    RusselThomas Profile Picture
    4,014 on at

    Hi @Anonymous,

    That sounds pretty odd 😊

    If you Reset() the gallery does anything happen? 

    The gallery should auto-refresh if PowerApps initiates a change to the source - odd that it's doing it for one field and not another...

    You can also perhaps try using one patch statement instead of two?

     

    Patch('Test Checklist USA',ThisItem,{
    Comments_E: ThisItem.Comments_E & Char(13) & User().FullName & " (" & Now() & "): Task Owner changed to: " & Taskowner.Text,
    'Task owner (prefilled)_E':Taskowner.Text
    })

     

    Kind regards,

    RT

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Russel you are a genious. 🌟

     

    Your suggestion of using one Patch has done the trick.

     

    I've no idea why patching twice did not work. I knew that the gallery should refresh after the patch but it's like the it does the first patch so fast that the second does not have time enough to refresh or something.

     

    Thank you so very much for your help.

  • RusselThomas Profile Picture
    4,014 on at

    hi @Anonymous ,

    It might just be a cache sync-timing thing running two patches straight after each other - but I've run loads of patches in a ForAll and it still updates as expected, so like I said - odd 😊

    Glad it's working!

    Kind regards,

    RT

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    You want to hear somethig odd-er (is that a word?):

     

    I have a button in the same app that does several patches to other fields in the same source. This button does about 7 patches one after the other.... and guess what? No issues there.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard