Spreadsheet Tasker Plugin

Spreadsheet Tasker Plugin is an Android plugin for updating and querying Google Spreadsheets from the Tasker app. This enables you to collect and push data to Google Spreadsheets from your Android device. Likewise you can query data from and existing spreadsheet and have your phone act accordingly.

The update plugin supports offline mode. Failed updates(due to no or flaky connectivity) is stored locally in a database. Subsequent updates will try to batch update these failed operations. This feature requires upgrading to the PRO version(in app billing).

Foo

Pick account, spreadsheet and sheet

First select the account for the Google Drive that contains the spreadsheet. Next pick the spreadsheet and the worksheet inside the spreadsheet.

Spreadsheet Spreadsheet

Updating

Enter the cell values to be inserted. The cell values must be separated by the cell divider(default the ; character). Notice that cell values can contain Tasker variables. Now select the output mode. Append adds the data to the first empty row in the worksheet while Fixed mode puts the data at a prosition yiou specify using

Default the cells are inserted in the first empty row. By changing the update mode to Fixed position one can specify the first cell to be updated in either A1 or R1C1 notation. Example: if position is set to either B5 or R2C5 the cells starting at the 2nd row and 5th column would be updated. You can also specify the position using a Tasker variable.

Spreadsheet Spreadsheet

Updating - Offline buffering(PRO feature)

When your device have a flaky connection or is offline or for some other reason the connection to Google's servers fails then the update will fail. See the section on Error handling on how to recover from an error.

To counter this problem enable Offline buffering. Now each update is first stored locally in a database as a pending update operation. Then an attempt is made to update the online spreadsheet. The operation is marked as committed if the update succeeds and as error otherwise.

Subsequent updates will automatically attempt to re-commit failed updates. You can also manually inspect the database by launching the Database viewer from the option menu. Here you can manually inspect and recommit operations.

Spreadsheet Spreadsheet

Updating - Multiple rows

Multiple rows can be updated in one operation by using the row divider(default the | character).

Example: This is the first row|This is the second row

Updating - Colors

Foreground and background colors can be set for each cell using this syntax: cell[foreground-color:background-color] where each color is specified using RGB hex syntax: RRGGBB or RGB. It's legal to specify only one of the colors. By appending a +(plus) sign after a color, the following cells will also get this color.

cellvalue[0000ff:00ff00] blue foreground, green background
cellvalue[00f:] red foreground
cellvalue[f00+:00f+] Make all the cells have red foreground and blue background

Example 1

Make a log of your phone's power level in a spreadsheet. Trigger the recording everytime you unlock the phone, start charging or similar conditions.

Spreadsheet     Spreadsheet

Example 2

Query ...

Error handling

Error handling with Tasker can be tricky. These are the advices given on the official Tasker page.

  • try enabling Menu / Prefs / More / Popup Warning/Errors to see if any errors are occuring (they may not be shown till you go back to the Tasker UI)
  • look in Menu / More / Run Log to see if the task is being carried out.

Likewise over at Pocketable there's a nice article on debugging.

If the spreadsheet plugin encounters an error, the local variable %err will be set and and the variable %errmsg will contain an explanation. Use the Continue Task After Error feature of tasker to popup a text message and show the reason for the error. These screenshots demonstrate how:

Spreadsheet     Spreadsheet