Legacy Dev Forum Posts

 View Only

Sign Up

Data Action Response Template - Sorting response ascending/descending

  • 1.  Data Action Response Template - Sorting response ascending/descending

    Posted 06-05-2025 18:45

    fransiska.hendra | 2024-02-07 16:16:55 UTC | #1

    Hi,

    Just wondering if anyone can help, we have a data action call external CRM API , integration works well, all good we can retrieve data. But after we retrieve response, need to sorting result (which Date format), ascending/descending.

    Question, can data action (translationMap Output) can do sorting ?

    Here is the unflattened output:

    {
      "status": 200,
      "data": {
        "cursor": 5,
        "limit": 5,
        "results": [
          {
            "first_name": "Van Cleef and Arpels ",
            "last_name": "   and Arpels",
            "reference_code": "FLIX-5BYDF5TM",
            "client_reference_code": "1OTHPSFNMDC",
            "is_vip": true,
            "booked_by": "Marcus Brodie",
            **"date": "2022-03-21",**
            "real_datetime_of_slot": "2022-03-21 13:30:00"
          },
          {
            
            "first_name": "Chamu",
            "last_name": "Chander",
            "reference_code": "UCCO-69EFRS9YR",
            "client_reference_code": "3T1VDO6",
            "is_vip": false,
            "booked_by": "Booking Widget",
            "date": "2023-01-23",
            "real_datetime_of_slot": "2023-01-23 12:30:00"
          },
          {
            "first_name": "Chamu",
            "last_name": "Chander",
            "reference_code": "FLIX-69T9JD3ML",
            "is_vip": false,
            "booked_by": "Booking Widget",
            "date": "2023-02-13",
            "real_datetime_of_slot": "2023-02-13 12:30:00"
          },
          {
            "first_name": "Chamu",
            "last_name": "Chander",
            "reference_code": "WONG-5SPYSV9FR",
            "is_vip": false,
            "booked_by": "Booking Widget",
            **"date": "2022-08-15",**
            "real_datetime_of_slot": "2022-08-15 12:45:00"
          },
          {
            "first_name": "Chamu Chander",
            "last_name": "Van Cleef Arpels",
            "reference_code": "BTOT-32AW3M5F8",
            "is_vip": true,
            "booked_by": "Jerelyn Tabuan",
            **"date": "2022-04-04",**
            "real_datetime_of_slot": "2022-04-04 20:00:00"
          }
        ]
      }
    }

    We need to translate output by Date using translation map, is it possible to do ?

    Appreciate for any advise.

    thank you Fransiska


    Jerome.Saint-Marc | 2024-02-07 13:10:58 UTC | #2

    Hello,

    No, there are no method available to sort your results by data in the translation map.

    Regards,


    Jason_Mathison | 2024-02-07 16:22:38 UTC | #3

    An option would be to take the output from this data action and pass it into another AWS Lambda / Google Function action that could sort the array for you in a couple of lines of node.

    --Jason


    fransiska.hendra | 2024-02-07 22:06:17 UTC | #4

    hi @Jerome.Saint-Marc & @Jason_Mathison ,

    Thanks alot for confirmation and advise, will update user accordingly.

    Fransiska


    system | 2024-03-09 22:06:49 UTC | #5

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 24512