web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with a Shopping Cart
Power Apps
Unanswered

Help with a Shopping Cart

(0) ShareShare
ReportReport
Posted on by

Good morning all! I'm having an issue with getting items from my shopping cart gallery into a new collection that will be used for submitting / tracking the order of a person. Below is an explanation of what I currently have and what I'm lacking:

 

Applications_1-1653319810450.png

 

A user uses the slider bar to set a quantity of the item they want an upon hitting the + button, it creates a collection which is displayed on the right-hand side. The code for the button is:

Collect(colUserShoppingCart, {Item: ThisItem.Description, Quantity: Slider5.Value}); Reset(Slider5)

 

I'm trying to get to where when a person clicks the submit order button it gathers the items/quantities from the gallery and displays it in a separate collection that will then populate another sharepoint list. Here is the code for that button:

Collect(colUserOrder, {Requestor: Name, Building: Building, Location: Seat, Email: Email, PhoneNumber: Phone, Items: colUserShoppingCart.Item, Quantity: colUserShoppingCart.Quantity}); Set(varShowSuccess, true)

 

When trying to view the data in that new collection I get this, where instead of displaying the text for the items/quantities, it says "object Object":

Applications_2-1653319866988.png

 

Does anyone know how to extrapolate the information from the first collection when they add it to a gallery into the new colection for order tracking?

 

Additionally, I'll have further questions on how to also push this collection to a SharePoint list, but trying to tackle one thing at a time haha.

 

Thank you all!

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Applications ,

     

    May I make a few suggestions:

     

    1. Split Order information (Requestor, Building, etc.) and LineItems (combination of ItemName, Quantity and OrderID). The latter you almost already have in the colUserShoppingCart.

    2. Use 1 control, for instance a form, to display the Order information  and second control, for instance a DataTable or Gallery, to display the LineItem information.

     

    This way you don't have to deal with nested tables or data normalization.

     

    Also, this is way easier to save to SharePoint 😉

     

     

  • Applications Profile Picture
    on at

    When adding the "submit" button that should combine both elements, what should that look like? Here's my screen now with those two elements separate: 

     

    Applications_0-1653574492778.png

     

    The data table is:

    DataTable1

    The gallery is:

    Gallery3

    The name of the SharePoint list I want it to publish to is:

    Inventory Supply Request

     

    Thanks for the help!

     

    Also, is there a way to have the Inventory Supply Request SharePoint list deduct the amount of items that were ordered from the originating list it came from?

  • Applications Profile Picture
    on at

    Anyone able to assist by chance? Thanks!

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Applications ,

     

    To make my proposal work you need two data sources (lists), one for orders and one for LineItems. 

     

    The submit button would then perform (at least) two actions:

    1. Submit the form to the order list.

    2. Patch the colUserShoppingCart collection to the LineItems list.

     

    The third action is then to update the Inventory list by looping through all items in the colUserShoppingCart and deducting the the ordered quantity from the stock quantity. This can be done by using the ForAll() and Patch() functions.

  • Applications Profile Picture
    on at

    So then how would I be able to see who ordered which line items through the two lists? They would be separate at that point, correct? So I wouldnt be able to see "User1 ordered X number of item"? 

  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Applications ,

     

    As previously mentioned, a third column (OrderID) should be added to the colUserShoppingCart to maintain the relation with the Order.

  • Applications Profile Picture
    on at

    Gotcha @BCBuizer , I created a new issue post as I've followed that but have a new error now: 

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Collect-Not-Posting-Info-To-SharePoint-List/m-p/1603617#M410298

     

    Any thoughts on how to remedy that? 

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Applications ,

     

    I have replied to your new topic as well. Can you please mark this one as solved for the benefit of the community?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard