Pulling records from another app with notifications

Pulling records from another app with notifications

Hello,

Can someone please give me some direction on this.

I have an app called Receipts that user's submit vehicle receipts to. It includes maintenance, fuel, etc. with the current mileage.

I want to set it up so that the last person to submit a fuel or oil receipt for a vehicle, becomes the "owner" for that vehicle. Also the current mileage should be stored on the first oil change, called initial_oil. When the current mileage for that vehicle  = initial_oil + 4500 I would like to send a notification to the "owner". 

My question is, what is the best way to achieve this? How do i grab the latest owner of the vehicle? I understand I would use something similar to Receipt[Type == "Fuel" or Oil_Change == true].Vehicle, but it needs to be the latest record for that vehicle and return the mileage and employee. Also how do I use a persistent variable like initial_oil across multiple records?