Populate a field from last value

Hi all, I am working on an inventory tool in appsheet.  We have thousands of SKUs but only about a dozen storage locations.  I would like to be able to scan an item and enter a location (i.e. A1) and once I hit save, I would like the location field to automatically populate with A1.  Once I move to A2 I would manually edit the location field and want it to remember A2 moving forward (and so on and so forth).

Is there a way to do this in Appsheet?  Appreciate the help in advance!

0 6 88
6 REPLIES 6

Hey man,

I'm sure there's a shorter version of that, but this should work:

 

Initial Value of Location Field = 

 

INDEX(SELECT(Inventory_Table[Location], [Inventory ID] = MAXROW("Inventory_Table", "_RowNumber")), 1)

 

Inventory ID = The Keyfield of your Inventory Table

Cheers

Thank you for the reply, Doesnโ€™t seem to work though - when I save and the next display opens up, the location field goes blank.  hmmmmmโ€ฆโ€ฆ

Hey,

probably because you're using an enum field? In that case you gotta select "Allow other values"

Cheers

One way is creating a variable, attaching it to the user's data, such as:

Table Users:
 [1] User Id (text)
     ...user data...
 [n] Var Last Inventory Location (text, Ref, enum, or whatever 'A1' and 'A2' are)

Then when the form is called, have it auto-fill by setting the column's initial value to the current user's [Var Last Inventory Location], such as:

ANY(SELECT(Users[Var Last Inventory Location], (Email = USEREMAIL())))
 ...or if you have a slice named 'Me' that is filtered to the current user...
ANY(Me[Var Last Inventory Location])

When the form saves, you can call a hidden action to save the variable to the current user's row, either through automation or as part of a grouped sequence of actions.

Is this what you were thinking?

We do not have different users, just one sign in. ๐Ÿ˜ž

If there's only one person using it at a time, then you could create a variable table not attached to any user. It would be one row deep, with all your variables (or just the one). For example:

Table "Variables":
 [1] Last Location (text, Ref, enum, or whatever A1 and A2 are)
 ...any other variable columns (or not)...

Then when the form is called, have it auto-fill by setting the initial value to:

ANY(Variables[Last Location])

 And finally, you save the variable in a hidden action when the form is saved, whether that's by automation or a grouped sequence of actions.

Top Labels in this Space