cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Save action removes record in input gallery

I posted a similar problem before (https://powerusers.microsoft.com/t5/General-Discussion/Save-action-removes-part-of-record-in-input-g...).  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.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Save action removes record in input gallery

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.

View solution in original post

1 REPLY 1

Re: Save action removes record in input gallery

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.

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,540)