The Goal: I am building a poultry management app to track 1,000 birds. I need a unified “Medical History” for each bird that stays intact even when they move between locations.
My Current Setup: I have a Health_Events table that acts as a single source of truth. It uses a TargetID to link events to three different levels:
-
Batch Level: (e.g., “Batch 101” got Newcastle vaccine).
-
Location Level: (e.g., “Area 1” got vitamins in the water).
-
Individual Level: (e.g., “Bird #55” treated for a wound).
In my Inventory Table (Individual Birds), I use a Query Column to pull all matching events from the Health_Events table where:
-
TargetID= This Bird’sBatchIDOR -
TargetID= This Bird’sBirdIDOR -
TargetID= This Bird’s currentLocation.
The Problem: The “Location” history is ephemeral. When I move a batch from Area 1 to Area 2, the Query filter in the Inventory table updates to “Area 2.” Consequently, all the historical medical records linked to “Area 1” disappear from the bird’s timeline because the Location match is no longer true.
The Strategy I’m Attempting: I want to use a “Move Button” that performs a mass update (moving 1,000 birds at once) while simultaneously “stamping” the old location’s history into a permanent record before the birds leave.
Where I’m Stuck: I am trying to use a Helper Table (a single-row “Scratchpad”) to capture the Move details (Source Area, Destination Area, and Move Method). However, I’m having trouble:
-
Passing the “Source” selection from the Helper Table into an
Add Rowaction for theHealth_Eventstable. -
Ensuring the “Location-specific” meds from the old area are permanently “attached” to the birds/batch so they don’t vanish after the
Locationcolumn in the Inventory table is updated to the new area.
Question for the community: How can I best “snapshot” the current location-based history and re-attach it to a Batch or Bird record during a mass move action so the timeline remains complete?