Hello PowerApps community,
I'm stuck here on something pretty complex. I hope I can explain it clearly here and we can come up with some ideas for how to tackle.
Scenario:
- Users select an Event from dropdown
- A timestamp for Now() is generated
- User can adjust timestamp to actual for the activity and add comments as needed
- I also have some hidden fields that calculate the duration between the LAST submitted record and the CURRENT one
- User clicks "Add Event" button
- OnSelect of the "Add Event" button, Event, Timestamp and Duration are collected and displayed in a Gallery below
- This is all good as long as they record Events IN ORDER

The Problem:
- The list of items in the Events dropdown is ~10-12
- If user adjusts a new Event Timestamp to be a time BEFORE the last Timestamp in the Collection, the Duration is off
- Again, this is because the hidden helper fields calculate the Duration based on the LAST Timestamp in the Collection and the current Timestamp
Example of the issue:

Questions:
- How would I lookup in the collection, where the current Event Timestamp should "fit", then calculate Duration?