Query + relations #114
-
Hi, data = client.databases.query(
**{
"database_id": DATABASE_ID_MY_UNI_TABLE,
"filter": {
"and": [
{
"property": "NAME", "multi_select": {"contains": "XXX"}
},
{
"type": "relation_Name", "relation": [{"id":"ID_of_my_relation"}]
}
]
}
}
)
return MyData(data=data) i get an Error type like this: raise APIResponseError(response, body["message"], code) while data = client.databases.query(
**{
"database_id": DATABASE_ID_MY_UNI_TABLE,
"filter": {
"and": [
{
"property": "NAME", "multi_select": {"contains": "XXX"}
}
]
}
}
)
return MyData(data=data) works fine. It can't be an ID error or something else |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
i also trid both results in an error. |
Beta Was this translation helpful? Give feedback.
-
I'm getting a lot of errors like this:
when I query a db that has a relationship in it. It looks like it's expecting a PropertyValueType it's not expecting. any idea what might be happening? Thanks! |
Beta Was this translation helpful? Give feedback.
In order to use the ID in the query you need to pass "contains" or "does_not_contain"
The second filter is failing because you are passing true as a string instead of a boolean