Choose ( Count ( f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ) - 1 ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 )
Count the number of fields (non-blank)
Then subtract one (because Choose uses a 0 as the first index).
I might have:
Count ( f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 )
; "" // 0 count means no return
; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7
of course, both our choices (pun) depend on the fields being filled correctly. If f1, f3 and f5 are completed, the Count() is 3 and the return is f3.
Too bad Last() doesn't work on a series of fields (getting the last non-blank value)...
Hmmmm, how about:
mylist = List ( f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 )
; GetValue ( myList ; ValueCount ( myList ) )
My first thought was Last(), and found that Last(List()) doesn't work.
GetValue() is good for some case, but has disadvantage of not work with values having linebreak in it.
Start testing on the last field and work to the first until you find a nonblank value. But if you mean the last field that data was entered in may not be the last field with data i.e. f1, f7, f3. Then use a script that is called with triggers on all fields that will save the data from the last nonblank field data was entered into.
Here is a couple of ways to do it
Make sure if using as a (best if Calculation [and usually globe]) field definition to uncheck "Do not evaluate if all referenced fields are empty"
Pick field.fmp12.zip 65.8 K
it's always something!
Good afternoon kentanderson,
I hope your day is going well. Are you storing each leg of the flight as an individual record related to a date? Have a great day!
Thank you guys so much. This worked perfectly. Sorry for the delay in getting back.
This really sounds like a case where a portal to a related table might simplify the process and add flexibility that you will not have with your set of fields all in one record.
And then Last() would work and data entry goofs that might fill in data into field 5 before someone fills in field 4 are also easier to avoid...