I'm having issues getting dynamic defaults to work within a repeat group.
This is for a time sheet form. The work flow I'd like is to have is: the enumerator selects all the staff on their crew from a select_multiple field ${crew}, then they enter a repeat group ${timesheet} that will allow them to add ${start} and ${end} times for each member of the crew they selected.
Often crew members will have the same start and end time so I'd like to have a dynamic default for these fields based on the last-entered value. I currently have ${timesheet}[position() = position(current()/..)-1/start as the default value. The issue seems to be that the repeat instances are created after the enumerator selects their crew members in the first step, before they have a chance to enter start and end times. If the enumerator selects multiple crew they will have empty start and end times. If the enumerator selects one crew member, enters start and end times, and then returns to the first step to select another crew member, the default values for the second time sheet are correct.
I'd like to avoid using a trigger as I don't want calculated values to overwrite modified values.
Is this even possible or should I come up with a different work flow?