Can I use a value from the previous record in a calculation for the record i’m adding. I’m tracking my car mileage.
Mileage = 240,000
total gallons = 10
mpg = 30 calculated from ((240,000 – 239,700) / 10)
–
previous record
Mileage = 239,700
Hi Chris,
There’s no function for accessing the previous record directly. In a Script you could do it, but then you have to fetch the records, then get the record that’s at an index one behind the current record.
but I have a form and script which you will run on the selected record that can create a new record, copy the data from the original selected record, then switch to the new record.
Download the attached .tfarc file and import that into your document.
So what you do is when you have your most recent record selected, run the script called New Mileage
Entry (it’ll be on the Scripts tab on the right when you have the Form inspector panel visible). Then type in the new odometer value. Tap Forms will calculate the difference between the previous and new odometer values.
Hope that helps!
Brendan
Attachments:
You must be
logged in to view attached files.
I’ve been trying to get the form to import but so far haven’t. I’ll keep trying on my iphone.
Thanks for the script,
Chris
Do you mean the .tfarc file will not import for you? Did you try on your Mac or just your iPhone?