Hi everybody,
first post in the community, so I’ll try to provide a clear picture…
My goal is to keep consistent tags’ names and colours between two databases in Notion.
I’ve tried many solutions using the “Create a database item” module, but I wasn’t able to map the colour (the name was easy).
So I tried to use the “Make an API call” module, but I’m no programmer…
After several trial-and-error attempts, it looks like I managed to provide the correct JSON code (via the “Create JSON” module) to the API call module, but now I get another error: “[400] 0 is not a property that exists.”
This is how the test scenario is set:
- Webhook as trigger
- search the source database in notion (for a specific checkbox marking any change in the record)
- create the new database item in destination database (including tags)
- create JSON
- update the tags’ values in the destination scenario
Here’s the overall scenario:
Here’s the error I get:
I’ve tried to recreate the bundle with the Create JSON module:
Here’s the OUTPUT of the “Create JSON” module:
[
{
"json": "{\"id\":\"dbfe499a-e08a-4fa8-84f1-95e8799b0311\",\"object\":\"page\",\"parent\":{\"type\":\"database_id\",\"database_id\":\"237bee2c-808a-4592-b1ca-f4b627399c68\"},\"properties\":[{\"multi_select\":[{\"id\":\"4880ab00-4103-4c57-aef1-a57ae060f3ad\",\"name\":\"blu\",\"color\":\"blue\"}]}]}"
}
]
NOTE: the tags’ “id” is taken from the new item in the destination database, while “name” and “color” are taken from the source database.
I then put the JSON output in the body of the API call (and I believe that here I’m doing something very wrong…):
Here’s the “Make API call” INPUT:
[
{
"url": "/v1/pages/",
"body": "{\"id\":\"665d4c94-a9ea-4b91-88aa-d661c20ce22c\",\"object\":\"page\",\"parent\":{\"type\":\"database_id\",\"database_id\":\"237bee2c-808a-4592-b1ca-f4b627399c68\"},\"properties\":[{\"multi_select\":[{\"id\":\"4880ab00-4103-4c57-aef1-a57ae060f3ad\",\"name\":\"blu\",\"color\":\"blue\"}]}]}",
"method": "POST",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"version": "2021-08-16"
}
]
And here’s the OUTPUT…
[
null
]
I’m pretty sure I’m doing something very wrong with the JSON/API call, but do not know exactly what…
Any help is very much appreciated!