I have a "shopping cart" app. First screen is a gallery of items to choose to buy, and one field is ImageLink (from a SP list). If the item is selected it moves to next screen which is a Detailed Screen that shows that particular item, a description, and a place to enter how many you want to buy. At the bottom is a button to add that item to the Shopping Cart. The last screen is the actual shopping cart and the Items property on that gallery (called BrowseGallery2) is a Collection. It shows all the items selected in previous screens.
The problem I'm having is if there are multiple items in the shopping cart, the image of the item in that last screen changes over to the last item in the cart. So, all the images of every item in the cart are the same.
I have the Image property on the Shopping Cart screen set to BrowseGallery1.Selected.Imagelink. "BrowseGallery1" is the name of the Gallery on the first screen that shows all the items that can be ordered.
I'm not sure how to fix this so. each item has the pic of the actual item.
Consider collecting the image link of each item into your shopping cart collection, and then referring to the image link column in your last gallery. Your current code: BrowseGallery1.Selected.Imagelink is referring to a single record, which is the last one selected.
I have a OnSelect function that clears the shopping cart after it’s submitted data to SP, so that each new person gets an empty cart when the start a new order. how would I do that you’re suggesting? Thanks!
Sorry, I may be misunderstanding. Are you trying to get the images lined up with the correct products in your shopping cart collection before the cart is emptied? Or was the browse gallery experiencing the issue?
My thought is: as the user explores the products and selects them, keep all the data (including imagelink) for the selected products together in a collection until the user completes the purchase or abandons the cart. After that point, you can clear the cart collection.
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.
Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.