Function to map data

Hi - I’m a little rusty on my js and having a tough time getting my data to map properly to items.

Here’s the basic format of the results of my HTTP Request:

{
  "appointments": [
    {
      "id": "EaALh02zfPo8VB3JOnpq",
      "userId": "GCs5KuzPqTls7vWclkEV",
      "calendarProviderId": "0nU7uKSrtT2RVM1KknuF",
      "calendarId": "9qFx5qCKr3jIdBw0DiqB",
      "contactId": "v1kbP2GBSZq6yzRkh7KT",
      "calendarServiceId": "CVokAlI8fgw4WYWoCtQz",
      "isRecurring": false,
      "status": "booked",
      "appoinmentStatus": "confirmed",
      "title": "Calendar Standup",
      "locationId": "C2QujeCh8ZnC7al2InWR",
      "startTime": "2020-07-22T16:00:00+05:30",
      "endTime": "2020-07-22T16:30:00+05:30",
      "selectedTimezone": "Asia/Calcutta",
      "contact": {
        "id": "ocQHyuzHvysMo5N5VsXc",
        "locationId": "C2QujeCh8ZnC7al2InWR",
        "email": "[email protected]",
        "emailLowerCase": "[email protected]",
        "fingerprint": "91f4f0e0-e2dd-11ea-9b16-53b2d72e8a24",
        "timezone": "Asia/Calcutta",
        "country": "DE",
        "customField": [
          {
            "id": "MgobCB14YMVKuE4Ka8p1",
            "value": "dolor veniam qui"
          },
          {
            "id": "MgobCB14YMVKuE4Ka8p1",
            "value": "ullamco fugiat cillum"
          }
        ],
        "tags": [
          "est quis",
          "officia quis labore et nisi"
        ],
        "__moreField__": "ullamco ea voluptate"
      }
    },
    {
      "id": "EaALh02zfPo8VB3JOnpq",
      "userId": "GCs5KuzPqTls7vWclkEV",
      "calendarProviderId": "0nU7uKSrtT2RVM1KknuF",
      "calendarId": "9qFx5qCKr3jIdBw0DiqB",
      "contactId": "v1kbP2GBSZq6yzRkh7KT",
      "calendarServiceId": "CVokAlI8fgw4WYWoCtQz",
      "isRecurring": false,
      "status": "booked",
      "appoinmentStatus": "confirmed",
      "title": "Calendar Standup",
      "locationId": "C2QujeCh8ZnC7al2InWR",
      "startTime": "2020-07-22T16:00:00+05:30",
      "endTime": "2020-07-22T16:30:00+05:30",
      "selectedTimezone": "Asia/Calcutta",
      "contact": {
        "id": "ocQHyuzHvysMo5N5VsXc",
        "locationId": "C2QujeCh8ZnC7al2InWR",
        "email": "[email protected]",
        "emailLowerCase": "[email protected]",
        "fingerprint": "91f4f0e0-e2dd-11ea-9b16-53b2d72e8a24",
        "timezone": "Asia/Calcutta",
        "country": "DE",
        "customField": [
          {
            "id": "MgobCB14YMVKuE4Ka8p1",
            "value": "non ut"
          },
          {
            "id": "MgobCB14YMVKuE4Ka8p1",
            "value": "esse anim sint in"
          }
        ],
        "tags": [
          "velit et",
          "incididunt Lorem eiusmod aliquip nulla"
        ],
        "__moreField__": "minim Lorem in"
      }
    }
  ]
}

Can you help me with the function to map the items properly? I only need the ids, not the rest of the data.

No JS should be required. You can do that now with Item Lists node set to the operation “Split Out Items”. You can find the documentation here:

1 Like

Thank you! @jan