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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Update function

(0) ShareShare
ReportReport
Posted on by 209

Hello, I have a bit of a tricky situation here. I created a shopping cart app and have the users select items and the selected items show up in a gallery. In my shopping cart gallery I have a collection set up from my "Order" button 

 Collect(
 colShoppingCart,
 {
 Title: ThisItem.Title,
 Description: ThisItem.Description,
 DateNeeded: DatePicker1.SelectedDate,
 Qty: qtyTxtbox.Text,
 Box: varBoxCounter
 }
);
Reset(qtyTxtbox)

 And a second button labeled "Box"  Set(varBoxCounter, varBoxCounter + 20). When the buttons are clicked they are sent to a gallery for the user to see what was selected. My issue is when I press the box button twice, It shows up multiple times instead of overwriting the quantity showing one line. And what would be the smartest way to clear that "Box" variable if the user decided they didn't want the box anymore. I tried Reset(varBoxCounter) but I get an  back an error.

Broly123_0-1690199019690.png

 

 

#2. I have the label set up for the user to type the quantity they want. Problem is after they type in the value and it's sent to the gallery, if the user wanted to go back and add more of the same item, it gets written on a separate line in the gallery instead of also overwriting.

 

Broly123_1-1690199019697.png

 

Thank you to whoever can help!

 

 

Categories:
  • developerAJ Profile Picture
    4,763 on at
    If(IsBlank(LookUp(colShoppingCart,Title = ThisItem.Title,Title)),
     Collect(
     colShoppingCart,
     {
     Title: ThisItem.Title,
     Description: ThisItem.Description,
     DateNeeded: DatePicker1.SelectedDate,
     Qty: qtyTxtbox.Text,
     Box: varBoxCounter
     }
    ),
    Patch(colShoppingCart,LookUp(colShoppingCart,Title = ThisItem.Title),{
     Title: ThisItem.Title,
     Description: ThisItem.Description,
     DateNeeded: DatePicker1.SelectedDate,
     Qty: qtyTxtbox.Text,
     Box: varBoxCounter
     })
    );
    Reset(qtyTxtbox)

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard