...
We’ve created a simple example form. Select the employee, a location and a new extension number. Click the Update Google Sheet button, wait a few seconds and see that the sheet was successfully updated. We did this using this rule:
Code Block | ||
---|---|---|
| ||
/*member password, user*/ if (UpdateGoogleSheet.clicked) { var eid = EId.value; // Unique key in the Google Sheet row var headers = {"user":"<google id>","password":"<access<your access token>"}’; var updatequery = ‘'/google/spreadsheets/update/key/<spreadsheetkey><your spreadsheet key>?wsname=Locations & query = employeeid = ”‘+<the name of your worksheet tab>&query=employeeid="' + eid + ‘”‘'"'; var updateparams = ‘ '& updates = location =' ’+ Location.value + ‘',extension=' + Extension.value; extension = ’+ Extension.value; eval(‘x 'x=' ’+ http.put(updatequery + updateparams, null, headers, false)); } |
- It’s triggered by clicking on the Update Google Sheet button.
- We setup headers and an update query using your access token and spreadsheet key (the long ID in the URL of the Google Sheet).
- Add updateparams: we’re updating location and extension with new values.
- Run the update – perform an http.put() and eval the results.
...