Calendar.get_events - can't split the array response - SOLVED

Hi All, The idea is to search through calendar events for a specific entry. It used to work with list_events, but get_calendar function returns results slightly differently. Because CAL_NAME comes right after “calendar.”, Node Red SPLIT function does not work and I am not able to search the Array of the Events. I guess because it falsely treats CAL_NAME as another sub-level in the payload structure.
How do I search though the array? Thanks in advance!

{
   "type": "execute_script",
   "sequence": [
       {
           "service": "calendar.get_events",
           "data": {
               "start_date_time": msg.laikasnuo,
               "end_date_time": msg.laikasiki
            },
           "target": {
               "entity_id": [
                   "calendar.cal_name
                ]
            },
           "response_variable": "service_result"
        },
       {
           "stop": "done",
           "response_variable": "service_result"
        }
    ]
}

Payload structure:
image

Split function:
image

Split fails with:
image

See if you can use anything from here.

1 Like

Thanks for pointing to the right direction!

Having it like that did the job, I was able to access the array of the Events:
msg.payload.response['calendar.cal_name'].events