
Hi,
I am using the customise forms functionality of PowerApps to make more powerful SharePoint forms. We have a collection that populates data from another SharePoint list for line items within a Purchase Order form. When making any changes in Studio, this collection breaks and shows junk data (I believe from the first item in the Purchase Order List). I've included the ClearCollect() code below. Is there a reason why this is happening or is it just a bug? The intended data is shown as just one line, with the junk data as multiple blank lines.
OnNew:
NewForm(SharePointForm1);
Set(MainGUID, GUID());
ClearCollect(GoodsColl,AddColumns(Filter('PO-item',MasterID=MainGUID),"EditItem",true))
OnEdit:
Refresh('Raise a Purchase Order');
EditForm(SharePointForm1);
Set(MainGUID, SharePointIntegration.Selected.MasterID);
ClearCollect(GoodsColl,AddColumns(Filter('PO-item',MasterID=MainGUID),"EditItem",true))
OnView:
Refresh('Raise a Purchase Order');ViewForm(SharePointForm1);
Set(MainGUID, SharePointIntegration.Selected.MasterID);
ClearCollect(GoodsColl,AddColumns(Filter('PO-item',MasterID=MainGUID),"EditItem",true))
OnSelect for the button which appends items to the item line list:
Patch('PO-item', Defaults('PO-item'), {'Description of Goods/Services Ordered (by item)':Txt_Description.Text, Quantity:Txt_Qty.Text, 'Unit Price':Txt_UnitPrice.Text,Price:Txt_Price.Text, 'VAT Category': Dd_VATCat.Selected.Title, 'VAT (%)':Txt_VATRate.Text, 'VAT Total':Txt_VATTotal.Text,MasterID:MainGUID});
Refresh('PO-item');ClearCollect(GoodsColl,AddColumns(Filter('PO-item',MasterID=MainGUID),"EditItem",true));
Reset(Txt_Description);Reset(Txt_Qty);Reset(Txt_UnitPrice)
Incorrect:
Correct: