@mdevaney
Items in the gallery (gallery 2) are coming from collection (colQuoteProducts) which are being populated by another gallery (gallery 1).
Below is the expression of the button from gallery 1:
Patch(
'Quote Products',
Defaults('Quote Products'),
{
quoteid: LookUp(
Quotes,
quoteid = GUID(QuoteIdGuidLabel.Text)
),
quantity: 1,
quotedetailname: ThisItem.Product.Name,
'Existing Product': LookUp(
Products,
Product = ThisItem.Product.Product
),
Unit: LookUp(
Units,
uomid = ThisItem.Unit.Unit
), producttypecode: LookUp(
'Quote Products',
'Existing Product'.Product = ThisItem.Product.Product,
'Product type'
),
propertyconfigurationstatus: LookUp(
'Quote Products',
'Existing Product'.Product = ThisItem.Product.Product,
'Property Configuration'
)
}
);
ClearCollect(
colQuoteProducts,
Filter(
'Quote Products',
Quote.Quote = GUID(QuoteIdGuidLabel.Text)
)
);
ClearCollect(
colQuoteProductsGroupBy,
GroupBy(
colQuoteProducts,
"parentbundleid",
"flem_byparentproduct"
)
);
ClearCollect(
colQuoteProductsGroupBySum,
AddColumns(
colQuoteProductsGroupBy,
"Total Amount Sub Prod",
Sum(
flem_byparentproduct,
'Sub Amount'
),
"Total Unit Gross",
Sum(
flem_byparentproduct,
Amount
),
"Total Cost",
Sum(
flem_byparentproduct,
Cost
)
)
);
ForAll(
QuoteProductGallery.AllItems,
{
Quantity: Value(QtyTextInput.Text),
Duty: Value(DutyTextInput.Text),
'Supplier Discount': Value(DiscountTextInput.Text),
'Add Discount': Value(AddDiscountTextInput.Text),
FRT: Value(FRTTextInput.Text),
Other: Value(OtherTextInput.Text),
Margin: Value(MarginTextInput.Text),
'FX Rate': Value(FXRateTextInput.Text),
Cost: Value(CostLabel_1.Text),
quoteid: LookUp(
Quotes,
quoteid = GUID(QuoteIdGuidLabel.Text)
),
'Quote Product': GUID(QuoteProductIdLabel.Text),
'Supplier Cost Price': Value(PricePerUnitLabel.Text),
'Sub Amount': Value(TotalAmountLabel.Text)
}
);