I’m building an iOS shortcut that finds all events in a specified calendar for a chosen time period (start and end date). The result is then iterated through each event with a few actions that ultimately creates a dictionary of keys and values for each found event. This is then passed as a JSON url scheme for import to an app.
Problem: In addition, I’d like it to also filter out the first event that occurs each day in order to add an additional key:value pair in the dictionary. How do I do that?
Example: A calendar full of flights used by a pilot. Shortcut asks for a start and end date and look for some criteria between those dates in order to return each flight. Say I select 7 November to 10 November. It finds 3 flights day 1, 4 flights day 2, 4 flights day 3, no flights last day. All events are needed when iterated through each to create a dictionary that later results in a JSON url file for export. But it also needs to find which of all the events that is the first flight each day (regardless of number of following flights). This is going to be used to figure out the check-in time before the first flight each day and set that as a separate key/value pair in the dictionary for only those flights.
This is what I have so far: FTL Calc import shortcut Everything I have is working as intended, but I want to add this check-in feature as well. Later on also check-out (similar for the last flight each day but I assume the technique is going to be identical)
After a lot of experimenting, I found one way to do it:
I don’t know if it’s the most clever or effective way but it solved my problem.