
Hi,
Would someone advise me about how to update tables?
I have a purchase form that the user should add the list of items there.
Plus icon -> OnSelect is:
Collect(
tblPurchaseCollection,
{
CSerialNumber: Text(Last(tblPurchaseCollection).CSerialNumber + 1),
CProductName: txtProductNameInput.Text,
CProductQuantity: Value(txtQuantity.Text),
CProductPrice: Value(txtPrice.Text),
CProductCategory: ddCategory.SelectedText
}
);
Cancel icon -> OnSelect is:
RemoveIf(
tblPurchaseCollection,
CSerialNumber = ThisItem.CSerialNumber
);
DataTable1 -> Items is:
Filter(PurchaseCollection,ThisItem.'P.O.'=PO)
PurchaseCollection is a SharePoint list (Columns: Quantity, Category, PO, Price, ProductName)
My question is that how can I update the tblPurchaseCollection if the user typed some values by mistake? Right now user should remove that row and add it again. I tried with a patch but unsuccessful
Also, I have a Sum textbox to calculate Price * quantity, but I get a delegation warning:
If(SharePointForm1.Mode=FormMode.New,Text(Sum(tblPurchaseCollection,CProductPrice * CProductQuantity)),Text(Sum(Filter(PurchaseCollection,ThisItem.'P.O.'=PO),Price * Quantity)) ) & " " & DataCardValue14.Selected.Value //,"[$-en-US]$#,###.00")
Thanks in Advance
Hi @Setayesh2 ,
If you use a gallery instead of a DataTable, you can actually edit the items inside the control. Let's say you add TextInputs to display all the fields (Default = ThisItem.Column). You can then use the OnChange property to save any changes directly as they are made (OnChange = Patch(DataSource,ThisItem,{Column: Self.Text}).