Zoho Connections - Google Sheets

Zoho Connections - Google Sheets

Here's a great snippet obtained from the one & only Bharath Kumar, who has helped me enormously with my task of moving my external code internally to deluge. A million thanks to you Bharath.

If you need to post stuff to Google sheets, set up the new Zoho feature called connections with Google Sheets, remember the name you give to the connection. Then use the following deluge code to post your stuff:

url = "https://sheets.googleapis.com/v4/spreadsheets/1mbzxl7K7u9qo2nbt56edjhh8m0NiL2QM_Jy5HuHGeMwv08/values/yourSheetName!A2:B2:append?valueInputOption=RAW&includeValuesInResponse=true&alt=json";
params = {"values":{{invoicedate,customer,invoiceNum,invoiceTotal}}};
response = invokeurl
[
url :url
type :POST
parameters:params + ""
connection:"gdrive"
content-type:"application/json"
];

1mbzxl7K7u9qo2nbt56edjhh8m0NiL2QM_Jy5HuHGeMwv08 = your Google sheet ID
invoicedate,customer,invoiceNum,invoiceTotal = your deluge parameters
gdrive = the name of your connection
RAW : If you'd like a simple trigger to fire in Google Sheets, such as onChange - change this to : USER_ENTERED