notion-charts
notion-charts copied to clipboard
Handle new Notion's databases
Discussed in https://github.com/mathix420/notion-charts/discussions/25
Originally posted by Ravie13 March 18, 2022 Hi there - this looks like just the code I need! I followed the directions for a private notion page and ran it but I'm getting errors in the console. I'm wondering if it is because of the recent Notion Database updates?
Failed to load resource: the server responded with a status of 500 ()
(index):203 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map')
at (index):203:34
At that index in the code this is the function:
json.columns.map(function (column) {
const opt = document.createElement('option');
opt.innerText = column.name;
opt.value = column.id;
return opt;
}).forEach(function (child) {
fields.appendChild(child);
firstColumnSav = firstColumn.cloneNode(true);
firstColumnSav.querySelector('input').value = '';
});
```</div>