cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TJL550
Frequent Visitor

Tuck shop Point of Sales System - Editing the values of an item in sharepoint lists

Hi, I'm currently working on a tuck shop POS system for a small shop that I help out at, and I have currently run into a problem that I can't yet solve.

 

What I am trying to do, when I press sale, for one to be taken off the 'stock' value for the selected item, and one to be added to the 'sale' value for the selected item.

 

I have linked some reference images below.

 

Thanks Tom

 

TJL550_0-1653301336444.pngTJL550_1-1653301372120.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @TJL550 , 

 

Maybe you could try to use the Patch() function.

I have made a test for your reference.

 

1. Here is my SharePoint list.

vyujincuimsft_1-1653554060819.png

2. Select the Button and apply the following formula on its OnSelect property as:

Patch('Tuck Shop - Stock Management',Gallery6.Selected,{Stock:Gallery6.Selected.Stock-1,Sold:Gallery6.Selected.Sold+1})

vyujincuimsft_0-1653554044503.png

3. Select the Button and apply the following formula on its DisplayMode property as:

If(Gallery6.Selected.Stock-1<0, DisplayMode.Disabled, DisplayMode.Edit)

Result:

Sale.gif

 

Best Regards,
Charlie Choi

View solution in original post

2 REPLIES 2
v-yujincui-msft
Community Support
Community Support

Hi @TJL550 , 

 

Maybe you could try to use the Patch() function.

I have made a test for your reference.

 

1. Here is my SharePoint list.

vyujincuimsft_1-1653554060819.png

2. Select the Button and apply the following formula on its OnSelect property as:

Patch('Tuck Shop - Stock Management',Gallery6.Selected,{Stock:Gallery6.Selected.Stock-1,Sold:Gallery6.Selected.Sold+1})

vyujincuimsft_0-1653554044503.png

3. Select the Button and apply the following formula on its DisplayMode property as:

If(Gallery6.Selected.Stock-1<0, DisplayMode.Disabled, DisplayMode.Edit)

Result:

Sale.gif

 

Best Regards,
Charlie Choi

Thank you so much!

This helped a lot!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,272)