Sort API results in Repeating Group

Hi,

I’m struggling to figure out how to sort a list of results from an API response.

In a workflow I am doing the API request, and then display the list of results in a repeating group.

The API request is asking for a list of flight options from point A to point B on a specific date with some additional parameters (nbr of persons, nbr of flight stops, flight departure time after HH:mm). The request looks like this:
https://app.goflightlabs.com/search-all-flights?access_key=[here goes my api key]&adults=1&origin=BRU&destination=FRA&departureDate=2023-04-26&startFrom=10:15&stops=0

The API response is a list of flight options. I’ve added the API response at the bottom.
In my app, I want to display the flight list in a Repeating Group and sort the results by flight departure time.

The departure time is here in the response:
data > results > legs > departure
See highlighted below.

I thought I should sort the results using :sorted in my workflow but I don’t know how.

Any advice?

Thank you!

API response:

{
"success": true,
"data": {
    "results": [
        {
            "id": "10141-2304262005--32090-0-11616-2304262105",
            "legs": [
                {
                    "id": "10141-2304262005--32090-0-11616-2304262105",
                    "origin": {
                        "id": 10141,
                        "name": "Brussels International",
                        "displayCode": "BRU"
                    },
                    "destination": {
                        "id": 11616,
                        "name": "Frankfurt am Main",
                        "displayCode": "FRA"
                    },
                    "durationInMinutes": 60,
                    "stopCount": 0,
                    "isSmallestStops": true,
                    "departure": "2023-04-26T20:05:00",
                    "arrival": "2023-04-26T21:05:00",
                    "timeDeltaInDays": 0,
                    "carriers": {
                        "marketing": [
                            {
                                "id": -32090,
                                "name": "Lufthansa"
                            }
                        ],
                        "operationType": "fully_operated"
                    },
                    "segments": [
                        {
                            "id": "10141-11616-2304262005-2304262105--32090",
                            "origin": {
                                "flightPlaceId": "BRU",
                                "parent": {
                                    "flightPlaceId": "BRU",
                                    "name": "Brussels",
                                    "type": "City"
                                },
                                "name": "Brussels International",
                                "type": "Airport"
                            },
                            "destination": {
                                "flightPlaceId": "FRA",
                                "parent": {
                                    "flightPlaceId": "FRA",
                                    "name": "Frankfurt",
                                    "type": "City"
                                },
                                "name": "Frankfurt am Main",
                                "type": "Airport"
                            },
                            "departure": "2023-04-26T20:05:00",
                            "arrival": "2023-04-26T21:05:00",
                            "durationInMinutes": 60,
                            "flightNumber": "1019",
                            "marketingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            },
                            "operatingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            }
                        }
                    ]
                }
            ],
            "pricing_options": [
                "https://www.skyscanner.net/transport/flights/bru/fra/230426/config/10141-2304261315--32478-0-11616-2304261415?adults=1&adultsv2=1&cabinclass=economy&children=0&childrenv2=&destinationentityid=27541706&originentityid=27539565&inboundaltsenabled=false&infants=0&outboundaltsenabled=false&preferdirects=false&ref=home&rtn=0"
            ]
        },
        {
            "id": "10141-2304261315--32478-0-11616-2304261415",
            "legs": [
                {
                    "id": "10141-2304261315--32478-0-11616-2304261415",
                    "origin": {
                        "id": 10141,
                        "name": "Brussels International",
                        "displayCode": "BRU"
                    },
                    "destination": {
                        "id": 11616,
                        "name": "Frankfurt am Main",
                        "displayCode": "FRA"
                    },
                    "durationInMinutes": 60,
                    "stopCount": 0,
                    "isSmallestStops": true,
                    "departure": "2023-04-26T13:15:00",
                    "arrival": "2023-04-26T14:15:00",
                    "timeDeltaInDays": 0,
                    "carriers": {
                        "marketing": [
                            {
                                "id": -32478,
                                "name": "Brussels Airlines"
                            }
                        ],
                        "operationType": "fully_operated"
                    },
                    "segments": [
                        {
                            "id": "10141-11616-2304261315-2304261415--32478",
                            "origin": {
                                "flightPlaceId": "BRU",
                                "parent": {
                                    "flightPlaceId": "BRU",
                                    "name": "Brussels",
                                    "type": "City"
                                },
                                "name": "Brussels International",
                                "type": "Airport"
                            },
                            "destination": {
                                "flightPlaceId": "FRA",
                                "parent": {
                                    "flightPlaceId": "FRA",
                                    "name": "Frankfurt",
                                    "type": "City"
                                },
                                "name": "Frankfurt am Main",
                                "type": "Airport"
                            },
                            "departure": "2023-04-26T13:15:00",
                            "arrival": "2023-04-26T14:15:00",
                            "durationInMinutes": 60,
                            "flightNumber": "7019",
                            "marketingCarrier": {
                                "id": -32478,
                                "name": "Brussels Airlines",
                                "alternate_di": "SN",
                                "allianceId": -31999
                            },
                            "operatingCarrier": {
                                "id": -32089,
                                "name": "Lufthansa CityLine",
                                "alternate_di": "CL"
                            }
                        }
                    ]
                }
            ],
            "pricing_options": [
                "https://www.skyscanner.net/transport/flights/bru/fra/230426/config/10141-2304261440--32090-0-11616-2304261540?adults=1&adultsv2=1&cabinclass=economy&children=0&childrenv2=&destinationentityid=27541706&originentityid=27539565&inboundaltsenabled=false&infants=0&outboundaltsenabled=false&preferdirects=false&ref=home&rtn=0"
            ]
        },
        {
            "id": "10141-2304261440--32090-0-11616-2304261540",
            "legs": [
                {
                    "id": "10141-2304261440--32090-0-11616-2304261540",
                    "origin": {
                        "id": 10141,
                        "name": "Brussels International",
                        "displayCode": "BRU"
                    },
                    "destination": {
                        "id": 11616,
                        "name": "Frankfurt am Main",
                        "displayCode": "FRA"
                    },
                    "durationInMinutes": 60,
                    "stopCount": 0,
                    "isSmallestStops": true,
                    "departure": "2023-04-26T14:40:00",
                    "arrival": "2023-04-26T15:40:00",
                    "timeDeltaInDays": 0,
                    "carriers": {
                        "marketing": [
                            {
                                "id": -32090,
                                "name": "Lufthansa"
                            }
                        ],
                        "operationType": "fully_operated"
                    },
                    "segments": [
                        {
                            "id": "10141-11616-2304261440-2304261540--32090",
                            "origin": {
                                "flightPlaceId": "BRU",
                                "parent": {
                                    "flightPlaceId": "BRU",
                                    "name": "Brussels",
                                    "type": "City"
                                },
                                "name": "Brussels International",
                                "type": "Airport"
                            },
                            "destination": {
                                "flightPlaceId": "FRA",
                                "parent": {
                                    "flightPlaceId": "FRA",
                                    "name": "Frankfurt",
                                    "type": "City"
                                },
                                "name": "Frankfurt am Main",
                                "type": "Airport"
                            },
                            "departure": "2023-04-26T14:40:00",
                            "arrival": "2023-04-26T15:40:00",
                            "durationInMinutes": 60,
                            "flightNumber": "1013",
                            "marketingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            },
                            "operatingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            }
                        }
                    ]
                }
            ],
            "pricing_options": [
                "https://www.skyscanner.net/transport/flights/bru/fra/230426/config/10141-2304261120--32090-0-11616-2304261220?adults=1&adultsv2=1&cabinclass=economy&children=0&childrenv2=&destinationentityid=27541706&originentityid=27539565&inboundaltsenabled=false&infants=0&outboundaltsenabled=false&preferdirects=false&ref=home&rtn=0"
            ]
        },
        {
            "id": "10141-2304261120--32090-0-11616-2304261220",
            "legs": [
                {
                    "id": "10141-2304261120--32090-0-11616-2304261220",
                    "origin": {
                        "id": 10141,
                        "name": "Brussels International",
                        "displayCode": "BRU"
                    },
                    "destination": {
                        "id": 11616,
                        "name": "Frankfurt am Main",
                        "displayCode": "FRA"
                    },
                    "durationInMinutes": 60,
                    "stopCount": 0,
                    "isSmallestStops": true,
                    "departure": "2023-04-26T11:20:00",
                    "arrival": "2023-04-26T12:20:00",
                    "timeDeltaInDays": 0,
                    "carriers": {
                        "marketing": [
                            {
                                "id": -32090,
                                "name": "Lufthansa"
                            }
                        ],
                        "operationType": "fully_operated"
                    },
                    "segments": [
                        {
                            "id": "10141-11616-2304261120-2304261220--32090",
                            "origin": {
                                "flightPlaceId": "BRU",
                                "parent": {
                                    "flightPlaceId": "BRU",
                                    "name": "Brussels",
                                    "type": "City"
                                },
                                "name": "Brussels International",
                                "type": "Airport"
                            },
                            "destination": {
                                "flightPlaceId": "FRA",
                                "parent": {
                                    "flightPlaceId": "FRA",
                                    "name": "Frankfurt",
                                    "type": "City"
                                },
                                "name": "Frankfurt am Main",
                                "type": "Airport"
                            },
                            "departure": "2023-04-26T11:20:00",
                            "arrival": "2023-04-26T12:20:00",
                            "durationInMinutes": 60,
                            "flightNumber": "1009",
                            "marketingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            },
                            "operatingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            }
                        }
                    ]
                }
            ],
            "pricing_options": [
                "https://www.skyscanner.net/transport/flights/bru/fra/230426/config/10141-2304261440--32478-0-11616-2304261540?adults=1&adultsv2=1&cabinclass=economy&children=0&childrenv2=&destinationentityid=27541706&originentityid=27539565&inboundaltsenabled=false&infants=0&outboundaltsenabled=false&preferdirects=false&ref=home&rtn=0"
            ]
        },
        {
            "id": "10141-2304261440--32478-0-11616-2304261540",
            "legs": [
                {
                    "id": "10141-2304261440--32478-0-11616-2304261540",
                    "origin": {
                        "id": 10141,
                        "name": "Brussels International",
                        "displayCode": "BRU"
                    },
                    "destination": {
                        "id": 11616,
                        "name": "Frankfurt am Main",
                        "displayCode": "FRA"
                    },
                    "durationInMinutes": 60,
                    "stopCount": 0,
                    "isSmallestStops": true,
                    "departure": "2023-04-26T14:40:00",
                    "arrival": "2023-04-26T15:40:00",
                    "timeDeltaInDays": 0,
                    "carriers": {
                        "marketing": [
                            {
                                "id": -32478,
                                "name": "Brussels Airlines"
                            }
                        ],
                        "operationType": "fully_operated"
                    },
                    "segments": [
                        {
                            "id": "10141-11616-2304261440-2304261540--32478",
                            "origin": {
                                "flightPlaceId": "BRU",
                                "parent": {
                                    "flightPlaceId": "BRU",
                                    "name": "Brussels",
                                    "type": "City"
                                },
                                "name": "Brussels International",
                                "type": "Airport"
                            },
                            "destination": {
                                "flightPlaceId": "FRA",
                                "parent": {
                                    "flightPlaceId": "FRA",
                                    "name": "Frankfurt",
                                    "type": "City"
                                },
                                "name": "Frankfurt am Main",
                                "type": "Airport"
                            },
                            "departure": "2023-04-26T14:40:00",
                            "arrival": "2023-04-26T15:40:00",
                            "durationInMinutes": 60,
                            "flightNumber": "7005",
                            "marketingCarrier": {
                                "id": -32478,
                                "name": "Brussels Airlines",
                                "alternate_di": "SN",
                                "allianceId": -31999
                            },
                            "operatingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            }
                        }
                    ]
                }
            ],
            "pricing_options": [
                "https://www.skyscanner.net/transport/flights/bru/fra/230426/config/10141-2304261315--32090-0-11616-2304261415?adults=1&adultsv2=1&cabinclass=economy&children=0&childrenv2=&destinationentityid=27541706&originentityid=27539565&inboundaltsenabled=false&infants=0&outboundaltsenabled=false&preferdirects=false&ref=home&rtn=0"
            ]
        },
        {
            "id": "10141-2304261315--32090-0-11616-2304261415",
            "legs": [
                {
                    "id": "10141-2304261315--32090-0-11616-2304261415",
                    "origin": {
                        "id": 10141,
                        "name": "Brussels International",
                        "displayCode": "BRU"
                    },
                    "destination": {
                        "id": 11616,
                        "name": "Frankfurt am Main",
                        "displayCode": "FRA"
                    },
                    "durationInMinutes": 60,
                    "stopCount": 0,
                    "isSmallestStops": true,
                    "departure": "2023-04-26T13:15:00",
                    "arrival": "2023-04-26T14:15:00",
                    "timeDeltaInDays": 0,
                    "carriers": {
                        "marketing": [
                            {
                                "id": -32090,
                                "name": "Lufthansa"
                            }
                        ],
                        "operationType": "fully_operated"
                    },
                    "segments": [
                        {
                            "id": "10141-11616-2304261315-2304261415--32090",
                            "origin": {
                                "flightPlaceId": "BRU",
                                "parent": {
                                    "flightPlaceId": "BRU",
                                    "name": "Brussels",
                                    "type": "City"
                                },
                                "name": "Brussels International",
                                "type": "Airport"
                            },
                            "destination": {
                                "flightPlaceId": "FRA",
                                "parent": {
                                    "flightPlaceId": "FRA",
                                    "name": "Frankfurt",
                                    "type": "City"
                                },
                                "name": "Frankfurt am Main",
                                "type": "Airport"
                            },
                            "departure": "2023-04-26T13:15:00",
                            "arrival": "2023-04-26T14:15:00",
                            "durationInMinutes": 60,
                            "flightNumber": "1011",
                            "marketingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            },
                            "operatingCarrier": {
                                "id": -32089,
                                "name": "Lufthansa CityLine",
                                "alternate_di": "CL"
                            }
                        }
                    ]
                }
            ],
            "pricing_options": [
                "https://www.skyscanner.net/transport/flights/bru/fra/230426/config/10141-2304261120--32478-0-11616-2304261220?adults=1&adultsv2=1&cabinclass=economy&children=0&childrenv2=&destinationentityid=27541706&originentityid=27539565&inboundaltsenabled=false&infants=0&outboundaltsenabled=false&preferdirects=false&ref=home&rtn=0"
            ]
        },
        {
            "id": "10141-2304261120--32478-0-11616-2304261220",
            "legs": [
                {
                    "id": "10141-2304261120--32478-0-11616-2304261220",
                    "origin": {
                        "id": 10141,
                        "name": "Brussels International",
                        "displayCode": "BRU"
                    },
                    "destination": {
                        "id": 11616,
                        "name": "Frankfurt am Main",
                        "displayCode": "FRA"
                    },
                    "durationInMinutes": 60,
                    "stopCount": 0,
                    "isSmallestStops": true,
                    "departure": "2023-04-26T11:20:00",
                    "arrival": "2023-04-26T12:20:00",
                    "timeDeltaInDays": 0,
                    "carriers": {
                        "marketing": [
                            {
                                "id": -32478,
                                "name": "Brussels Airlines"
                            }
                        ],
                        "operationType": "fully_operated"
                    },
                    "segments": [
                        {
                            "id": "10141-11616-2304261120-2304261220--32478",
                            "origin": {
                                "flightPlaceId": "BRU",
                                "parent": {
                                    "flightPlaceId": "BRU",
                                    "name": "Brussels",
                                    "type": "City"
                                },
                                "name": "Brussels International",
                                "type": "Airport"
                            },
                            "destination": {
                                "flightPlaceId": "FRA",
                                "parent": {
                                    "flightPlaceId": "FRA",
                                    "name": "Frankfurt",
                                    "type": "City"
                                },
                                "name": "Frankfurt am Main",
                                "type": "Airport"
                            },
                            "departure": "2023-04-26T11:20:00",
                            "arrival": "2023-04-26T12:20:00",
                            "durationInMinutes": 60,
                            "flightNumber": "7003",
                            "marketingCarrier": {
                                "id": -32478,
                                "name": "Brussels Airlines",
                                "alternate_di": "SN",
                                "allianceId": -31999
                            },
                            "operatingCarrier": {
                                "id": -32090,
                                "name": "Lufthansa",
                                "alternate_di": "LH",
                                "allianceId": -31999
                            }
                        }
                    ]
                }
            ],
            "pricing_options": [
                {
                    "agents": [
                        {
                            "id": "xpuk",
                            "name": "Expedia",
                            "is_carrier": false,
                            "update_status": "current",
                            "optimised_for_mobile": true,
                            "live_update_allowed": true,
                            "rating_status": "available",
                            "rating": 2.48,
                            "feedback_count": 8376,
                            "rating_breakdown": {
                                "reliable_prices": 2.149844,
                                "clear_extra_fees": 3.813268,
                                "customer_service": 4.996316,
                                "ease_of_booking": 2.260028,
                                "other": 1.713152
                            }
                        }
                    ],
                    "price": {
                        "amount": 329.66,
                        "update_status": "current",
                        "last_updated": "2023-04-24T13:48:29",
                        "quote_age": 1
                    }
                }
            ]
        }
    ]
}

}

FYI - the API does not have any sorting parameters unfortunately so I will have to do it in Bubble.