cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ramole
Post Prodigy
Post Prodigy

If Existing in the collection

Hi all,


I have  a collection that is being created based on cart, so I want to push this changes back to the quantiles incrementing value, if is already existed in cart example i have add an item on collection which the quantity is 5 item and now if I add same item but the quantiles 6 pieces now, i would like collection to update the changes 

 

This my currant formula to collect and i would like to add:

 

Collect(
    CartList,
    {CItemSerialNumber: Text(Last(CartList).CItemSerialNumber + 1),
        ID: Concatenate(
            Text(
                Now(),
                "[$-en-US]mm/dd/yyyy hh:mm:ss"
            ),
            First(ProductInfoCollection).Title,
            Text(txtProductsQty.Text)
        ),
        Name: First(ProductInfoCollection).'Sales Description',
        SKU: First(ProductInfoCollection).Title,
        Amount:Value( txtProductsQty.Text),
        Price: First(ProductInfoCollection).'Sales Price / Rate',
        CATEGORY: First(ProductInfoCollection).CATEGORY,
        Image: First(ProductInfoCollection).ImageLink,
        'Quantity On Hand': First(ProductInfoCollection).'Quantity On Hand',
        Total: (txtProductsQty.Text * First(ProductInfoCollection).'Sales Price / Rate')
    }
)

 

 

Thanks

 

 

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also close the item., please consider giving it Thumbs Up.
1 ACCEPTED SOLUTION

Accepted Solutions
Ramole
Post Prodigy
Post Prodigy

Solved now and if any needs in the future here is the formula i have added 😀

 

UpdateContext({CartselectedItem: LookUp(CartList,SKU = First(ProductInfoCollection).Title)});
If(!IsBlank(CartselectedItem), 
Update(CartList, 
CartselectedItem,
{SKU:CartselectedItem.SKU, //First(ProductInfoCollection).Title,
Name: CartselectedItem.Name,   //First(ProductInfoCollection).'Sales Description',
                                //    selectedItem.Total * selectedItem.Price,
Amount: CartselectedItem.Amount + Value(txtProductsQty.Text),
Price:CartselectedItem.Price, // this updates price if its already in the cart
Total: CartselectedItem.Amount * CartselectedItem.Price, //this updates Total if its already in the cart
Image:CartselectedItem.Image, //this updates Image if its already in the cart
'Quantity On Hand': First(ProductInfoCollection).'Quantity On Hand', //this updates Quantity On Hand from product list if its already in the cart
CATEGORY: First(ProductInfoCollection).CATEGORY // this updates CATEGORY if its already in the cart


});
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also close the item., please consider giving it Thumbs Up.

View solution in original post

2 REPLIES 2
Ramole
Post Prodigy
Post Prodigy

Solved now and if any needs in the future here is the formula i have added 😀

 

UpdateContext({CartselectedItem: LookUp(CartList,SKU = First(ProductInfoCollection).Title)});
If(!IsBlank(CartselectedItem), 
Update(CartList, 
CartselectedItem,
{SKU:CartselectedItem.SKU, //First(ProductInfoCollection).Title,
Name: CartselectedItem.Name,   //First(ProductInfoCollection).'Sales Description',
                                //    selectedItem.Total * selectedItem.Price,
Amount: CartselectedItem.Amount + Value(txtProductsQty.Text),
Price:CartselectedItem.Price, // this updates price if its already in the cart
Total: CartselectedItem.Amount * CartselectedItem.Price, //this updates Total if its already in the cart
Image:CartselectedItem.Image, //this updates Image if its already in the cart
'Quantity On Hand': First(ProductInfoCollection).'Quantity On Hand', //this updates Quantity On Hand from product list if its already in the cart
CATEGORY: First(ProductInfoCollection).CATEGORY // this updates CATEGORY if its already in the cart


});
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also close the item., please consider giving it Thumbs Up.

View solution in original post

Hi,

 

Thanks for your follow up post! I am glad that you were able to get this working. Hopefully this will prove useful to future communities users.

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (39,741)