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 / Adding and subtracting...
Power Apps
Unanswered

Adding and subtracting inventory

(0) ShareShare
ReportReport
Posted on by 18

Hello everyone,

I'm currently in the process of creating a model driven app.


I have two tables Items and Inventory  In the app for both pages forms can be found.
I have now finished it so far that when you go to the "Inventory" page, you select an item (solved with lookup to item), then enter a stock (Bestand) for the previously selected item. So far so good!

 

azaterol_0-1703358822420.png

 

Now to my problem:

I now want to be able to use two form fields (Input and Output) to change the stock that you previously entered. If an input is added, the stock is summed up with the current stock number. If an output is entered, the stock is of course subtracted.

 

This view i want at the end for the site: Inventory 

#ID is autoincremt after submit the form of Inventory

 

     #ID                Item                                    Stock           Input             Outputazaterol_1-1703358877754.png

 

Does somebody has any idea?

I have the same question (0)
  • JonDoesFlow Profile Picture
    1,304 on at

    Hey @azaterol 

     

    You will need to use Power Automate or a real time workflow process to achieve this requirement. 



    ---------------------------------------------------------------------------


    If I have helped you with an answer, please accept this post as a solution and thumbs up my reply. Thanks !

    Blog - JonDoesFlow
    Twitter - JonDoesFlow
    YouTube - JonDoesFlow

  • ivan_apps Profile Picture
    2,187 Moderator on at

    I believe you’ll want a third table of transactions (your input/output). Your items are simply a definition of a tracked item - in your example, bier - but maybe you want to add what type of beer, hefe, export, pils, etc.

     

    Your Inventory table will be a container definition for the beer selected, and hold all the summary data, as well as each individual transaction (via 1:N relationship). Transactions should be a subgrid on the Inventory table.

     

    Now your transactions should be a running count of Inputs/purchases or Outputs/sales. The very first entry should be your starting balance. You can have 2 separate fields here if you really want them in different columns but you don’t have to. If they are in the same column, just be sure to define outputs with a negative value.

     

    now back on your Inventory table, create a ‘roll up’ field under a decimal or whole number. It will ask you to save and pop open a new window. Here you can define this roll up value to be the sum of all child transactions in the ‘inputs’ minus the sum of all ‘outputs’. This is your inventory count. When you add it to the form, there’s a little calculator in the field, you can click on it to calculate right now, otherwise it will run a system job periodically to calculate the value. 

    Last thing you need is to add the Rollup field to the Transactions subgrid view or default view, along with your input and output fields. This will be possible by adding a ‘related’ column in the view creation, and selecting the inventory relationship. 

    this should create your desired UI! I would recommend adding a quick create form for transactions to have a better experience quickly adding a transaction from within the inventory table.

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