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:
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":
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!
Solved! Go to Solution.
Hi @Applications ,
As previously mentioned, a third column (OrderID) should be added to the colUserShoppingCart to maintain the relation with the Order.
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 😉
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:
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?
Anyone able to assist by chance? Thanks!
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.
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"?
Hi @Applications ,
As previously mentioned, a third column (OrderID) should be added to the colUserShoppingCart to maintain the relation with the Order.
Gotcha @BCBuizer , I created a new issue post as I've followed that but have a new error now:
Any thoughts on how to remedy that?
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?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
180 | |
45 | |
45 | |
34 | |
34 |
User | Count |
---|---|
255 | |
82 | |
78 | |
67 | |
65 |