How do I default a value to the value entered in the last record?

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
First time making an app, so apologies if this is obvious...

I am attempting to build an app that tracks Items.  Each Item has a Location.  When entering the data, the Items from one Location are entered, then the Items from the next Location, then the next, etc....  The Location on the data entry form is related to another table.  Data entry would be easiest if the Location defaulted to last value entered.  Is there an easy way to do this?  Do I need to embed another form (like a heading)?

Any insight would be appreciated by a newby.

Thanks
Photo of Daniel Eastman

Daniel Eastman

  • 100 Points 100 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,306 Points 50k badge 2x thumb
Is there a relationship here between Location entries and the Item?
Photo of Daniel Eastman

Daniel Eastman

  • 100 Points 100 badge 2x thumb
Yes.  There are two tables.  One table is Locations, and one table is Items.  The Items table has a relationship to the Locations table.  Many Items for each Location.
Photo of Daniel Eastman

Daniel Eastman

  • 100 Points 100 badge 2x thumb
Here is what I am trying to do...

It is just a simple application to track food that is in multiple kitchens so that leftover items can be used before spoilage.  For example, one of the chefs planned on using 18 lbs of asparagus in his soup.  His projections changed, so he ended up using only 10 lbs.  He has 8 lbs, and does not have asparagus soup on his menu for the week.  However in another of our kitchens, a different chef has grilled asparagus planned on a menu.  The product could be used over there, and not go to waste.  Multiply this by multiple ingredients in multiple locations.  Each chef inventories their own kitchen, and currently, they are just emailing one another.  Instead, I am hoping to make a handy-dandy little application that shows the location, amount and type of food that a chef is hoping to get used elsewhere.  Each chef enters the items into a form, and right now, they have to enter the kitchen (it is just a dropdown, so not a big deal) over and over again.  A simpler/better solution would be to add it once per time they sit down to enter the information.  The way I currently have it set up, I was hoping for an easy way to just default the Location (kitchen) to the value that was last entered into the table.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,306 Points 50k badge 2x thumb
No problem.
We will need to make a reverse relationship.
Edit the relationship to create a new Summary field of the Maximum Record ID#.  Call the field [Record ID# of last location].

Then make a new relationship where 1 Location has Many items.

On the right hand side use the field you just created as opposed to the field [Related Location] which it will suggest.  Do not bring in any lookup fields.

Then edit the relationship to bring down the location.  Call it [Most Recent Location]

Now you have the location of the most recent Location on the item record.  Look that up down to the Locations table.

Now make a form rule on he Locations form that says

When the location is blank
Change the value in the field location to the value in the field 
[Most Recent Location]
Photo of Daniel Eastman

Daniel Eastman

  • 100 Points 100 badge 2x thumb
Awesome, thanks!