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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Stock Balance Calculat...
Power Apps
Answered

Stock Balance Calculation after Stock has been Issued out

(0) ShareShare
ReportReport
Posted on by 10

Hello All,

Please I am building an Inventory Management App, 

 

1. I need the Stock Balance to be displayed automatically, pull out details from the Database, instead of entering the Quantity  manually

2. I  need a formula to display the Available Stock Balance after  Stock Out (Amount of Stock Issued)  has been Done

 

Note: On entering a new Data , I want the Stock Balance to auto-populate /display from the last Stock Balance

 

i.e Stock Balance = Stock Balance - Stock Out (Amount of Stock Issued)

 

I need a solution that the Stock balance will be updated after the Stock has been issued Out

 

Thanks for your suggestion.

 

dapdomma01_0-1717924723289.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    QQY Profile Picture
    on at

    hi 

     

    you could follow below steps:

     

    1, Set the selected record as VarRecord, and set the editmode property of stock out to viewmode

    2, add a Slider out of the EditForm to show the stock out qty this time you want issue, min Value 0, max Value = VarRecord,.Stock Balance - VarRecord,.Stock Out

    3, add a text out of the EditForm to show the stock balance after you drag the slider, set the text property = VarRecord.Stock Balance - Slider.Value

    4, use a patch function in Form Oncuess property: Patch(datasource,VarRecord,{Stock Out: VarRecord.Stock Out+Slider.Value})

     

  • ibidapobabatunde Profile Picture
    10 on at

    Hello,

    Thanks, I tried it but it does not work. I think I am not getting what you are trying to explain.

    kindly assist if you can break it down.

    I am a beginner in  PowerApp Development.

    Note: On entering a new Data, I want the Stock Balance to auto-populate /display from the last Stock Balance.

     

    many Thanks

  • QQY Profile Picture
    on at

    Which step are you stuck on?

  • ibidapobabatunde Profile Picture
    10 on at

    Thanks for your response, I have been available to do the Slider only

     

    I am stuck at No. 1,2,3,4

     

     

    dapdomma01_0-1718023157925.png

     

  • QQY Profile Picture
    on at

    just change as below

     

    1,  set the editmode property of stock out to viewmode

    2, add a Slider out of the EditForm to show the stock out qty this time you want issue, min Value 0, max Value = Gallery.Selected.Stock Balance - Gallery.Selected.Stock Out

    3, add a text out of the EditForm to show the stock balance after you drag the slider, set the text property = Gallery.Selected.Stock Balance - Slider.Value

    4, use a patch function in Form Oncuess property: Patch(datasource,Gallery.Selected,{Stock Out: VarRecord.Stock Out+Slider.Value})

  • ibidapobabatunde Profile Picture
    10 on at

    Thanks, a lot.

    There is much improvement now.

    The only problem I have now is at Step 4

    After selecting the Form and at On Sucess Property, I got this error message below:

     

    dapdomma01_1-1718101203937.png

    dapdomma01_0-1718101122566.png

     

  • QQY Profile Picture
    on at

    Patch(datasource,VarRecord,{Stock Out: VarRecord.Stock Out+Slider.Value})

    I saw you have missed the 2nd parameter in the Patch Function.

  • ibidapobabatunde Profile Picture
    10 on at

    Hi,

    I appreciate your response.

    It is not working, I think I missed Step 1 and also see the error when I include the 2nd parameter as screenshot below,

    dapdomma01_4-1718168272220.png

     

     

    dapdomma01_3-1718167880332.png

     

     

    dapdomma01_0-1718167821608.png

     

    dapdomma01_1-1718167846183.png

    dapdomma01_2-1718167865866.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard