Coda to Json in JavaScript/Google Apps Script

Hi -

I am experimenting with Coda for a project and I will need an external service that will pull/push info from/to Coda. I am using the Google Apps Script recipe that has been around in the forums.

Is there a one-step solution to get information from a Coda table into JSON programmatically? I can get the data (rows) without column names, and I can get column names without the data. I was planning to use listRows to get the data (without the column names), then using listColumns to get the column names, then merge them in a JSON, but thought that I am either overcomplicating stuff or someone else has already built this.

Help is appreciated!

Hi @Oren_Pinsky, your approach seems right.

One thing you could to to avoid the extra listColumns call is to use the useColumnNames query parameter in the listRows endpoint. That will cause the returned output to have the column names directly instead of column IDs. You can see how this approach is used in the Getting Started Guide that’s linked to from the API docs – search that page for “useColumnNames: true”.