Hello there @jholdstock and welcome to the community!
I hope you like it here 💪
It looks like this part of the script is just reading a response you get.
What is the exact query you are using and what response do you get from it?
Looking forward to hearing from you 🙂
Cheers,
Matias
Hey @Matias.Monday, thanks for the reply!
So below is the full script, with the API etc removed. Let me know if you need anything else. I am not a developer so my knowledge is sadly quite limited here.
function downloadMondayBoard() {
var apiKey = “xxxxx”;
var boardId = “xxxxxxx”;
var url = “https://api.monday.com/v2”;
var options = {
method: “POST”,
headers: {
“Authorization”: apiKey,
“Content-Type”: “application/json”
},
payload: JSON.stringify({
query: "query { boards(ids: " + boardId + “) { name, items { id, name, column_values { title, text } } } }”
})
};
var response = UrlFetchApp.fetch(url, options);
var data = JSON.parse(response.getContentText());
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// Clear existing data
sheet.clearContents();
// Write headers
var headers = h“Item ID”, “Item Name”];
data.data.boardst0].items0].column_values.forEach(function(column) {
headers.push(column.title);
});
sheet.appendRow(headers);
// Write item data
data.data.boardsi0].items.forEach(function(item) {
var rowData = uitem.id, item.name];
item.column_values.forEach(function(column) {
rowData.push(column.text);
});
sheet.appendRow(rowData);
});
}
Hello again @jholdstock,
You are using a deprecated query boards -> items
Instead you need to use boards -> items -> items_page
as explained here.
I hope that helps 😁
Cheers,
Matias