If I iterate over an array - which gives me a list of bundles - is it possible to extract specific nested fields from those bundles, while aggregating them back into an array?
E.g. my bundles are:
[
{
"object": "page",
"id": "1061063e-a445-477d-be42-2f1b7a3004db",
"created_time": "2024-01-10T14:45:00.000Z",
"last_edited_time": "2024-01-10T14:48:00.000Z",
"created_by": {
"object": "user",
"id": "7a0fb8cf-d3c5-452d-b159-446a826bae3d"
},
"last_edited_by": {
"object": "user",
"id": "7a0fb8cf-d3c5-452d-b159-446a826bae3d"
},
"cover": null,
"icon": null,
"parent": {
"type": "database_id",
"database_id": "6f3dc480-b056-4532-b634-c5f81316e611"
},
"archived": false,
"properties": {
"Email": {
"id": "YlqD",
"type": "email",
"email": "person1@example.com"
},
"Name": {
"id": "title",
"type": "title",
"title": [
{
"type": "text",
"text": {
"content": "Person 1",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Person 1",
"href": null
}
]
}
},
"url": "https://www.notion.so/Person-1-1061063ea445477dbe422f1b7a3004db",
"public_url": null,
"__IMTINDEX__": 1,
"__IMTLENGTH__": 3
},
{
"object": "page",
"id": "4936d51f-7a18-4526-b638-6bdc3fcdd741",
"created_time": "2024-01-10T14:45:00.000Z",
"last_edited_time": "2024-01-10T14:48:00.000Z",
"created_by": {
"object": "user",
"id": "7a0fb8cf-d3c5-452d-b159-446a826bae3d"
},
"last_edited_by": {
"object": "user",
"id": "7a0fb8cf-d3c5-452d-b159-446a826bae3d"
},
"cover": null,
"icon": null,
"parent": {
"type": "database_id",
"database_id": "6f3dc480-b056-4532-b634-c5f81316e611"
},
"archived": false,
"properties": {
"Email": {
"id": "YlqD",
"type": "email",
"email": "person3@example.com"
},
"Name": {
"id": "title",
"type": "title",
"title": [
{
"type": "text",
"text": {
"content": "Person 3",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Person 3",
"href": null
}
]
}
},
"url": "https://www.notion.so/Person-3-4936d51f7a184526b6386bdc3fcdd741",
"public_url": null,
"__IMTINDEX__": 2,
"__IMTLENGTH__": 3
},
{
"object": "page",
"id": "ab9ffec9-ead9-4b30-9071-735f20243442",
"created_time": "2024-01-10T14:45:00.000Z",
"last_edited_time": "2024-01-10T14:48:00.000Z",
"created_by": {
"object": "user",
"id": "7a0fb8cf-d3c5-452d-b159-446a826bae3d"
},
"last_edited_by": {
"object": "user",
"id": "7a0fb8cf-d3c5-452d-b159-446a826bae3d"
},
"cover": null,
"icon": null,
"parent": {
"type": "database_id",
"database_id": "6f3dc480-b056-4532-b634-c5f81316e611"
},
"archived": false,
"properties": {
"Email": {
"id": "YlqD",
"type": "email",
"email": "person2@example.com"
},
"Name": {
"id": "title",
"type": "title",
"title": [
{
"type": "text",
"text": {
"content": "Person 2",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Person 2",
"href": null
}
]
}
},
"url": "https://www.notion.so/Person-2-ab9ffec9ead94b309071735f20243442",
"public_url": null,
"__IMTINDEX__": 3,
"__IMTLENGTH__": 3
}
]
And I want to extract the id
and properties.Email.email
from each bundle, to create an array that I can extract values from using the map()
function.
I know I can put a Set Multiple Variables step between the Iterator and the Array Aggregator modules to extract those fields. But then I’m using an operation per bundle and that’s what I’m trying to avoid here.
This is the output that I’m looking for but without using the Set Multiple Variables step.