Drop down with Add on the Fly - How to default a field in the new entry with a value from the existing form

I have a truck Receiving Form where the user indicates which Division their receiving from.
The same form has a trailer dropdown box for the driver to select the trailer their unloading to.

When they add a trailer into the drop down box from the Receiving Form, I need the division on the receiving form to populate the division field of the new vehicle they’re inputting so administrators know which division is inputting new trailers.

I tried this expression in the Initial Value of the Vehicles (Trailer Storage) table but it doesn’t recognize the receiving_id field as its from the Receiving table and generates an error.
IF(CONTEXT(View)=“Scale Receiving Entry”,[receiving_id].[Division],"")

Any ideas on how I can populate the field? Thanks so much!

Receiving Form


Add Trailer (Vehicle) Form

Add Vehicle Form

I don’t think this will be possible “on-the-fly”. Since the record from the first form hasn’t been saved yet.

You could setup an action that runs on form-save, which executes another action on the vehicles table, that’ll update the column, using a formula such as:

LOOKUP(
  MAAXROW( "truck receiving table" , "_RowNumber" ) ,
  "truck receiving table" ,
  "key column" ,
  "return value"
)
2 Likes

Thanks Marc, I’ll check into this as an option :slight_smile: