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?