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 Platform Community / Forums / Power Apps / Inventory management a...
Power Apps
Answered

Inventory management app with increase and decrease buttons

(0) ShareShare
ReportReport
Posted on by 98

Hi everyone,

first, I'll say that it's the first app I'm trying to build so I got much to learn.

I'm trying to build a quite easy inventory management app.

I got a sharepoint list with three columns -

 

Talko_0-1683532630456.png

 

On the app side, it looks like this - 

Talko_1-1683532731516.png

 

The idea is very simple, I want to be able to choose a number (by increasing or decreasing using + and - buttons),

and the number shown in the InputText box will be added or substracted to or from the Quantity shown for each row on the left.

 

What did I do until now? 

I defined that each TextInput box has a different variable for "OnSelect".

for example the first one -

Talko_2-1683532932202.png

 

and when clicking on the - button next to it, it looks like this :

Talko_3-1683532966938.png

When clicking on the + button :

Talko_4-1683533006214.png

and so on with the rest of the items, but with different letters (v,w,x,y,z).

 

While testing the app, it does increase and decrease the number shown in the InputText box,

But I do not understand how I make each "Save" button I created to actually update the quantity of the item in the sharepoint list and on the app itself.

 

Could anyone help me with that matter?

Thanks

 

 

Categories:
  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at

    Hi @Talko ,

     

    Try this function in "OnSelect" of Save button:

     

     

     

    Patch('yoursharepointdatasource',LookUp('yoursharepointdatasource',ProductID=ThisItem.ProductID),{Quantity:ThisItem.Quantity+v})

     

     

     

    Before that, remember to check Sharepoint column internal name by following guidance and ensure use the internal name in your function:

    What is SharePoint column internal name and where to find it (tomriha.com)

     

    Refer to this link for detailed introduction of Patch() function:

    Patch function in Power Apps (contains video) - Power Platform | Microsoft Learn

     

    Community Support Team _ Wenjuan Zou

    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Verified answer
    Ngo-Cong-Tuyen Profile Picture
    91 on at

    Hi, @Talko 

    If you have many products and you don't want create a new column in share point or don't want to create so much variables {v,w,x,y,z}, you can addcolumns at Apps (OnStart 😞

    ClearCollect(MyCollection,AddColumns(TuyenDemoDS, "ChangeQuantity",0));

    Then, you can change it easily: 

    NgoCongTuyen_0-1683540636328.png

    Patch(MyCollection, ThisItem, {ChangeQuantity:ThisItem.ChangeQuantity+1})

    Finally, the save button will work with:

    NgoCongTuyen_1-1683540714880.png

    Patch(TuyenDemoDS,LookUp(TuyenDemoDS,ID= ThisItem.ID),{Quantity: ThisItem.Quantity + ThisItem.ChangeQuantity});
    ClearCollect(MyCollection,AddColumns(TuyenDemoDS, "ChangeQuantity",0))

    I did it and success update in share point.

    Best regards,

    Tuyen.

  • Talko Profile Picture
    98 on at

    Thank you both for your answers.
    The problem with both cases, is that I always get the error "ThisItem isn't recognized".

    No matter how much tutorials I watched to build similar apps, I always get to the point where my code fails because of "ThisItem".

    What am I doing wrong?

  • Talko Profile Picture
    98 on at

    Also on @Ngo-Cong-Tuyen suggestion,

    I get this error as well - 

    Talko_0-1683541618661.png

     

  • Ngo-Cong-Tuyen Profile Picture
    91 on at

    May be your save button out of gallery:

    NgoCongTuyen_0-1683541627652.png

    Make sure all in gallery

  • Talko Profile Picture
    98 on at

    I'm sorry I didn't know they have to be all in the same group of objects.

    The current situation is - 

     

    Talko_0-1683542011327.png

    I was trying to cut and paste the objects from "BrowseScreen1" under Gallery 4" but it always take them back to "BrowseScreen1".

    Even when I try adding a new Button it keeps displaying it under BrowseScreen1

  • Ngo-Cong-Tuyen Profile Picture
    91 on at

    You have to click to gallery first and then click insert 

  • Talko Profile Picture
    98 on at

    Okay so I managed to put everything under Gallery4.

    Now, using your suggestions, whenever I'm pressing the + or - it immediately patches the quantity of the item next to it, but what I actually want is, that you can either insert the value manually or either use the + and - buttons to increase or decrease the number inside the  "TextInput" and just by clicking on the Save button, it will actually patch that number into the quantity.

    What in the code you advised me to use should be changed then?

  • Ngo-Cong-Tuyen Profile Picture
    91 on at

    You can read again my suggestion. First, I created a new collection to store data named: MyCollection. And I just changed it ( patch to it when click -  +). When i click the save button, it will be save in datasource named TuyenDemoDS in Sharepoint

  • Talko Profile Picture
    98 on at

    Yes I understand that,

    what I'm still not sure about is how to increase and decrease the quantity shown in the InputText box, without immediately patching the sharepoint list.

    I only want the Save button to patch, not the + and - buttons.

     

    Again, thank you so much for your assistance, I appreciate it!

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 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard