Hi @beatrizmoura26 ,
How are you adding these products to your collection?
If that's via Patch then you have to check if there is any records already in collection with this Products ID / Name.
If(IsBlank(LookUp(DataSource,ProductID = Value(ProductIDTextLabel.Text)),
Patch(DataSource, Defaults(DataSource),
{
Product_Value: Value(ProductValueTextLabel.Text)
}
),
Patch(DataSource,LookUp(DataSource,ProductID = Value(ProductIDTextLabel.Text)),
{
Product_Value: Sum(Filter(DataSource, ProductID = Value(ProductIDTextLabel.Text)))
}
)
)
)
As you haven't said how you are adding new records in collection then this would be for a manual use.
If needed for Gallery then the code would have to change a bit.
_____________________________________________________________________________________
Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!