@yashag2255,
Here's the code for the Save icon:
Update(col_ItemDetailNew, ThisItem, {ItemName: NewItemVal.Text, ItemDescription: NewDescripVal.Text, ItemQuantity: Value(NewQuantityVal.Text)});
Collect(col_ItemDetailNew, {ItemName: "", ItemDescription: "", ItemQuantity: 0})
Here's the relevant code from the OnSave property:
Set(var_ColRowCount, CountRows(col_ItemDetailNew));
Set(var_GalRowCount, CountRows(ItemDetailGalleryNew.AllItems));
If(var_ColRowCount=1 || !IsBlank(Last(ItemDetailGalleryNew.AllItems).ItemName), Notify("Cannot submit request. Items not saved. Click disk icon to save items, then click Save.", NotificationType.Error),
SubmitForm(SalesRequestFormNew);
Set(var_NewLastSubmitID, SalesRequestFormNew.LastSubmit.ID);
Set(var_NewLastSubmitTitle, SalesRequestFormNew.LastSubmit.DepartmentName & "-" & var_NewLastSubmitID);
RemoveIf(col_ItemDetailNew, IsBlank(ItemName) && IsBlank(ItemDescription) && ItemQuantity=0);
ForAll(col_ItemDetailNew,
Patch('Sales Item List', Defaults('Sales Item List'), {'Item Name': ItemName, 'Item Description': ItemDescription, 'Item Quantity': ItemQuantity, 'Request ID': var_NewLastSubmitID, Title: var_NewLastSubmitTitle}))