Skip to content

rollup property filters accept rich_text instead of text. #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #243
KoditkarVedant opened this issue Jul 10, 2022 · 0 comments · Fixed by #264 or #276
Closed
Tracked by #243

rollup property filters accept rich_text instead of text. #247

KoditkarVedant opened this issue Jul 10, 2022 · 0 comments · Fixed by #264 or #276
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@KoditkarVedant
Copy link
Contributor

KoditkarVedant commented Jul 10, 2022

Rollup property filters must now be constructed with the rich_text keyword instead of the text keyword if the value of the rollup is an array of rich_text.

Put concretely, if a page's rollup property is rendered like so:

"rollup property": {
    "id": "~%5Bw%5C",
    "type": "rollup",
    "rollup": {
        "type": "array",
        "array": [
            {
                "type": "rich_text",
                "rich_text": [
                    {
                        "type": "text",
                        "text": {
                            "content": "update text 2",
                            "link": null
                        },
                        "annotations": {
                            "bold": true,
                            "italic": false,
                            "strikethrough": false,
                            "underline": false,
                            "code": false,
                            "color": "red"
                        },
                        "plain_text": "update text 2",
                        "href": null
                    }
                ]
            },
            {
                "type": "rich_text",
                "rich_text": [
                    {
                        "type": "text",
                        "text": {
                            "content": "another text",
                            "link": null
                        },
                        "annotations": {
                            "bold": false,
                            "italic": false,
                            "strikethrough": false,
                            "underline": false,
                            "code": false,
                            "color": "default"
                        },
                        "plain_text": "another text",
                        "href": null
                    }
                ]
            }
        ],
        "function": "show_original"
    }
}

This filter will no longer work in version 2022-02-22:

{
    "filter": {
        "property": "rollup property",
        "rollup": {
            "any": {
                "text": {
                    "contains": "update text"
                }
            }
        }
    }
}

Instead, write:

{
    "filter": {
        "property": "rollup property",
        "rollup": {
            "any": {
                "rich_text": {
                    "contains": "update text"
                }
            }
        }
    }
}

Notion changelog: https://developers.notion.com/changelog/releasing-notion-version-2022-02-22

@KoditkarVedant KoditkarVedant added this to the 3.0.0 milestone Jul 10, 2022
@KoditkarVedant KoditkarVedant changed the title rollup query database filters no longer accept the text keyword. Use rich_text instead. rollup property filters accept rich_text instead of text. Jul 10, 2022
@KoditkarVedant KoditkarVedant added enhancement New feature or request help wanted Extra attention is needed up for grabs labels Jul 10, 2022
@KoditkarVedant KoditkarVedant linked a pull request Jul 10, 2022 that will close this issue
10 tasks
@KoditkarVedant KoditkarVedant self-assigned this Jul 10, 2022
@KoditkarVedant KoditkarVedant linked a pull request Jul 17, 2022 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
1 participant