Hi
My aim is to export each row of a board as a file (JSON payload) so I can import them into our system and use the values for calculations.
I have solved (via help on stackoverflow) getting the column_values ID and Text values as Key value pairs
eg
“column_values”: [ { “id”: “status”, “text”: “Working on it” } ]
becomes
“column_values”[{“status”: “Working on it”}]
using
results.data.boards[0].items[0].column_values=results.data.boards[0].items[0].column_values.map(x => ({[x.id] : x.text}));
Although some of the ID come across as text1, text2 instad of the actual text value
When I test this in the intergration it works and the full api payload is converted.
However when when I use the intergration in a Zap it fails with the error - Cannot read property ‘column_values’ of undefined.
The zap uses Mondays - Column Value Changed in Board in monday.com with a set board ID as the trigger to provide the Pulse ID
I then pass the Board ID and Pulse ID to the Monday api with the following request
const options = {
url: ‘https://api.monday.com/v2’,
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
‘Accept’: ‘application/json’,
‘Authorization’: bundle.authData.Authorization
},
params: {
‘Authorization’: bundle.authData.Authorization
},
body: {
‘query’: {boards (ids:${bundle.inputData.board_id}) {name items (ids:${bundle.inputData.item_id}) { name id column_values { id text } } } }
}
}
return z.request(options)
.then((response) => {
response.throwForStatus();
const results = response.json;
results.data.boards[0].items[0].column_values=results.data.boards[0].items[0].column_values.map(x => ({[x.id] : x.text}));
return results;
});
to return the Board Item and Column values - which fails with the error.