I have an order database that I am trying to manage duplicate entries. I m trying to create a process that will update duplicates and patch the rest of the items in a cartlist. He is the code I have so far. There are no errors but the else condition is working just not the first condition of when a duplicate is found. The end result is nothing.
ForAll(
cartlist, //cartlist is my collection
If(
LookUp(
lineItems.AllItems, //lineitems is a gallery
product_id in cartlist.ProductID,
true
),
UpdateIf(
'[dbo].[ORDER_ITEMS]', //SQL table
product_id exactin cartlist.ProductID,
{quantity: quantity}
),
Patch(
'[dbo].[ORDER_ITEMS]',
Defaults('[dbo].[ORDER_ITEMS]'),
{
order_id: OrderID,
product_id: ProductID,
quantity: QTY,
item_filled: 0
}
)
)
)