Hey all. New to appsheet here, but lots of e...

Hey all.

New to appsheet here, but lots of experience with google spreadsheets and scripting in them.

This is seeming to be a hard thing to search for so I will ask it here. I have an inventory spreadsheet, each row an item, 3 property columns (id,name,amount). I have a form for a user to fill out where they pick an inventory item from an Enum list, and input an amount (negative or positive). Is there some easy built in way that I am missing to use the data from the filled out form, to add or subtract to the inventory? Thanks!

Edit: An example. Say item 1 has an amount of 5. A user uses 1 of this item, so they fill out the form, selecting item 1 from the list, and inputting -1. I want the amount in the inventory sheet for item 1 to be automatically update (subtract 1 from it). I do not want the user to have the directly edit the inventory amount (that is easy app-wise, but hard on the user).

0 15 782
15 REPLIES 15

To clarify, is that a separate google form data youโ€™re using or an Appsheet-based form?

an appsheet form

Thank you for your help @tony and others. I just figured out how to do what I needed. It seems so simple now, but so complicated before.

@Marc_Dillon which isโ€ฆ?

Yah, youโ€™re right. I should describe my solution.

In my case I have a bunch of inventory items that I want to keep a running total on. Some days they get used up, some days we get a delivery of more.

A usage of inventory items usually isnโ€™t just one, it comes in a group of items used that needed to be connected.

I have three tables.

  1. A table of inventory items, this table started with just name of items. 2. A table of inventory adjustments, which has a label, and a list of references to: 3. A table of adjustment details. The details reference the inventory items, and back to the adjustment.

So a single adjustment can have any number of inventory item changes.

Then in the inventory table, there is an automatically created โ€œrelated โ€ฆโ€ virtual column. Manually create another virtual column, type Number, app formula: SUM(SELECT([Relatedโ€ฆ][Adjustment qty], true)). And that column adds up all total adjustments per inventory item.

Seeing as how I just figured it out, Iโ€™m sure that description was not the best. Let me know if you need more help.

@Marc_Dillon Could you please explain the above in a bit more detail, would be very much appreciated as trying to do similar. I donโ€™t need to keep a history. Just In, out, Current Stock where Current Stock = Current Stock+(In-Out)

@Kane_Group Which part needs more explanation? Actually you do need to keep a history, because thatโ€™s how the current stock is calculated; by keeping a sum of all history.

Hmmโ€ฆ Iโ€™m relatively new to the AppSheet platform, so take everything I say loosely. I might not be understanding your question as well.

That said, I have a personal app (different use case) that I think has the same functional need. This is how Iโ€™m doing it: 1) Connect spreadsheet to app 2) Go to Data => Columns => change the relevant fields to enumerated list and whatever else you would need. 3) Then, in the app, it should pretty much generate the form you need whenever you try and alter the data.

help.appsheet.com - Editing Your Columns Editing Your Columns help.appsheet.com

Thanks for the reply, but I donโ€™t think that helps. Iโ€™ve added an edit to the original post:

Edit: An example. Say item 1 has an amount of 5. A user uses 1 of this item, so they fill out the form, selecting item 1 from the list, and inputting -1. I want the amount in the inventory sheet for item 1 to be automatically update (subtract 1 from it). I do not want the user to have the directly edit the inventory amount (that is easy app-wise, but hard on the user).

tony1
New Member

@Marc_Dillon I think this app is close to what you want: appsheet.com - Dynamic inventory with qty - Scan items with quantities to keep a running inventory count

You can search over example apps here: https://www.appsheet.com/Support?q=inventory&hPP=10&idx=help&p=0&dFR[doc_type][0]=Apps&is_v=1 Dynamic inventory with qty - Scan items with quantities to keep a running inventory count appsheet.com

Hi, I am new to this but wonโ€™t it work if you have a โ€œgoods_in tableโ€, a โ€œgoods_out tableโ€ and your โ€œstock_tableโ€ to be:

(whatโ€™s next is not the way to do it but itโ€™s the way I know to explain it)

SUM(goods_in)-SUM(goods_out) ?

I hope itโ€™s not a foolish answer

So it seems the answer is no, not really a super easy built in way to keep a dynamic inventory.

Yes I figured I could keep a sum of all โ€œpurchasesโ€ and โ€œsalesโ€, but then I thought I would somehow have to do some sort of messy vertical lookup formula for each product. Thatโ€™s spreadsheet thinking though.

The app Tony posted seems to use another virtual column called โ€œRelated Purchasesโ€ and โ€œrelated salesโ€, which are lists of type Ref, and an app formula of โ€œREF_ROWS(โ€œSalesโ€, โ€œProduct Barcodeโ€)โ€ . And the โ€œtotal salesโ€ virtual column is defined by โ€œSUM(SELECT([Related Sales][Quantity], true))โ€ .

So it seems that for every product inventory, there is a virtual column keeping a list of sales and purchases of that product, then a virtual column summing those lists. Is that the gist of it?

I might just got you an quick and easy โ€œhalf of an answerโ€. If you group your view by product and set Group aggregate to SUM[qty] itโ€™s being done in one go.

If there is a way to change the user input from a positive entry to a negative

record, done.

but that will be a view only information

tony1
New Member

@Marc_Dillon Those โ€œRelated โ€ฆโ€ columns are automatically generated by AppSheet when you have a reference from one table to another. So in this case, each Sale record has a reference to a particular Product record.

tony1
New Member

help.appsheet.com - References Between Tables References Between Tables help.appsheet.com

Top Labels in this Space