I posted a similar problem before (https://powerusers.microsoft.com/t5/General-Discussion/Save-action-removes-part-of-record-in-input-gallery/m-p/284409#M82348). However it's a bit different. Instead of removing part of the record, it removes the entire record. Now, the fix last time was to change the command from Patch to Update. Also, in the older post, it was writing to a new/empty collection. In this case, it's writing to a SPO list. Not sure if that makes a difference, but feel I should mention it. I have also tried the fix from last time, and it doesn't work. So, here is the code from the app's OnStart:
ClearCollect(col_AllRequests, SortByColumns(RequestsForm, "ID", Ascending));
ClearCollect(col_AllItems, SortByColumns('Item List', "ID", Ascending))
The code from the edit screen's OnVisible property:
Set(var_SharepointSelectedID, SharePointIntegration.SelectedListItemID);
UpdateContext({var_RecordCheck: LookUp(col_AllItems, SharePointIntegration.SelectedListItemID in 'Request ID')});
ClearCollect(col_ItemDetailEdit, ShowColumns(Filter(col_AllItems, var_SharepointSelectedID in 'Request ID'), "ItemName", "ItemDescription", "ItemQuantity","ID", "Title"))
The code from the SharePointIntegration -> OnSave property:
If(SharepointFormMode="CreateForm", SubmitForm(RequestFormNew), SubmitForm(RequestFormEdit))
Here is the code from the Save icon/button:
UpdateContext({var_RecordCheck2:ThisItem.ID in col_ItemDetailEdit.ID});
UpdateContext({var_RecordCheck3:!IsBlank(Last(col_ItemDetailEdit).ItemName)});
Update(col_ItemDetailEdit,ThisItem, {Title:ThisItem.Title,Item:EditItemVal.Text,Description:EditDescripVal.Text,Quantity:Value(EditQuantityVal.Text)});
If(var_RecordCheck3,
Collect(col_ItemDetailEdit, {Item:"",Description:"",Quantity:0}));
If(var_RecordCheck2,
Patch('Item List',LookUp(col_AllItems,ID=ThisItem.ID),{'Item Name':EditItemVal.Text,'Item Description':EditDescripVal.Text,'Item Quantity':Value(EditQuantityVal.Text),'Request ID':var_SharepointSelectedID,Title:SharePointIntegration.Selected.Title}),
Patch('Item List',Defaults('Item List'),{'Item Name':EditItemVal.Text,'Item Description':EditDescripVal.Text,'Item Quantity':Value(EditQuantityVal.Text),'Request ID':var_SharepointSelectedID,Title:SharePointIntegration.Selected.Title}))
Any help is appreciated.
Nevermind, I fixed it. I wasn't refreshing the collection that gallery was pulling from, so I used ClearCollect to re-initialize the collection, and now any record's change is reflected in the gallery.