I am building a form for electro-fishing which has a nested repeat
- main layer : waterbody/stream and year (MAIN)
- first repeat: location of electro-fishing (LOCATION)
- second repeat: individual fish at location of electro-fishing (FISH)
The team will sometimes electrofish at multiple locations at the same waterbody on the same day. They will also sometimes return to that waterbody within the same year.
The problem I'm having is generating unique ID's between all tables, specifically the (FISH) IDs.
The team has an existing database and the fish IDs are continuous over visits.
For example:
sample 1: July 28 (15 fish collected) - fish IDs would range from ABC-1 to ABC-15
sample 2: July 28 (10 fish collected) - ABC-16 to ABC- 25
sample 3: Aug 14 (20 fish collected) - ABC-26 to ABC-45
For each fish sample, I want to generate a unique ID that identifies the (LOCATION) and would look something like this
sample 1: ABC-July 28 - 1
sample 2: ABC - July 28 -2
sample 3: ABC - Aug 14 - 1
If I keep the first and second repeats separate (and not nested) then I can automatically keep track of the correct Fish ID using position(..). However when I do this, the (LOCATION) ID changes to the newest LOCATION ID
If I keep them nested, which I feel is much cleaner when in the field, then the (FISH) ID resets at 1 everytime you create a new (LOCATION)
* all collection would be offline so there isn't the option to send the survey and then edit using the inbox for multiple visits at one location in the same day
Any advice or workarounds would be appreciated ! Happy to share snippets of the XLS form !