Tasker Add a row of data to a Google Spreadsheet (no plugins) 2019-07-08

Tasker allows you to use most Google APIs using its HTTP Auth and Request actions

  1. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    joaomgcd submitted a new AutoApps project:

    Add a row of data to a Google Spreadsheet (no plugins) - Tasker allows you to use most Google APIs using its HTTP Auth and Request actions

    Read more about this project...
     
  2. freakonomic

    freakonomic New Member

    Joined:
    Jul 23, 2019
    Messages:
    1
    Likes Received:
    0
    I am not getting at HTTP AUTH in the mobile app
     
  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You have to use Tasker 5.8+ :) Get it here.
     
  4. dr_nick

    dr_nick New Member

    Joined:
    Jul 23, 2019
    Messages:
    2
    Likes Received:
    0
    this is excellent - thanks so much!

    i am having trouble with the very last step: Assistant integration (the whole point of me trying to set this up!)
    Everything works fine through tasker, but i cannot get the join URL to work.

    I followed the link (https://joinjoaomgcd.appspot.com/) and enabled this, but it is now showing as "No Devices".
    I am now unclear with what I replace YOUR_DEVICE_NAME and _YOUR_API_KEY...
    I have gone into console.developers.google.com/apis/credentials/ and generated an API key for this, as previous instructions were only to create oauth2 credentials and copied this into the YOUR_API_KEY section, and used the name of my phone in the YOUR_DEVICE_NAME bit

    clearly this is wrong as though assistant recognises my command and replies appropriately, no line is added to my sheet

    hoping someone can help

    (the previous steps are so detailed i could easily follow them, and the videos really helped; but the last bit is less detailed - perhaps needs thrashing out jsut a little - and the video could show you setting it up, rather than just the result?)

    I am so grateful for this tutorial - it obviously takes a lot of effort, and this is exactly what i've been looking for! thanks so much
     
    Last edited: Jul 23, 2019
  5. dr_nick

    dr_nick New Member

    Joined:
    Jul 23, 2019
    Messages:
    2
    Likes Received:
    0
    so i have been fiddling further and worked out that Join is a separate system - I cannot believe I havent seen this before, so i'm all signed up to that now both with chrome extension and on android phone.
    I have also deleted the tasks I created with the tutorial and downloaded the attached profile instead.
    now I can't find where to input my sheetID - there are two variables %sheetid and %SheetId that seem to reference each other... and the link to documentation leads me back here which discusses how to write it from scratch, but the output from that is quite different than the downloaded profile...
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Glad you like it! :) Go to the Vars tab and edit the %SheetId variable. That should do it!
     
  7. Austen Blair

    Austen Blair New Member

    Joined:
    Jul 25, 2019
    Messages:
    1
    Likes Received:
    0
    Very excited to see this ability in Tasker, and this project is almost exactly what I've been looking for this week!

    Will the Google Cloud Project/API eventually cost money? I'm seeing menus about free trials and quotas, and I'm not familiar with the platform.
    Thanks for all your hard work joao!
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Some APIs can cost money, but it doesn't cost money if you keep below the quotas. :)

    The Sheets API in particular I don't think is paid at all :) Glad you like it!
     
  9. Carlo Hancke

    Carlo Hancke New Member

    Joined:
    Aug 23, 2019
    Messages:
    1
    Likes Received:
    0
    First of all, thank you for creating this plugin.
    Can someone please put me in contact with the developer?

    For my task, I need it to push the data to google sheets in offline mode "Available offline",

    with the mobile data and wifi turned off.

    Tasker turns mobile data on every hour to the sink only calculated result, not the bulk data set all the time.

    Draining to mush battery and use to mush mobile date like it is now.

    I am so grateful for this app and don't mind to pay again to get this sorted.
     
  10. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Unfortunately this won't work while the device is offline, sorry! Maybe you can store the data yourself in Tasker and then bulk set it when the device is online?
     
  11. inn508

    inn508 New Member

    Joined:
    Jul 28, 2016
    Messages:
    4
    Likes Received:
    1
    Follow the actions. I can append a row of data to a Google Spreadsheet.
    But when I try to use spreadsheets.batchUpdate in the same spreadsheet, it always report error 400
    ------------------------------------------------
    "code": 400,
    "message": "The API Key and the authentication credential are from different projects.",
    "status": "INVALID_ARGUMENT",
    ------------------------------------------------

    https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate
    I already add all scropes, but it still report error 400.
     
  12. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you please export your task's description (not xml) so I can take a look? Long-click the task in Tasker->export description Thanks in advance
     
  13. macedo

    macedo New Member

    Joined:
    Sep 26, 2019
    Messages:
    1
    Likes Received:
    0
  14. inn508

    inn508 New Member

    Joined:
    Jul 28, 2016
    Messages:
    4
    Likes Received:
    1
    ----------- description start ----------
    batchUpdateTest (99)
    A1: Perform Task [ Name:Auth-multi Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable:%headers Stop:Off ]
    A2: Flash [ Text:%headers Long:Off ]
    A3: HTTP Request [ Method:pOST URL:https://content-sheets.googleapis.c...n&key=AIzaSyAa8xxxxxxxxxxxxxxxHiGGx_S0vMPScDM Headers:%headers Query Parameters: Body:{"requests":[{"insertDimension":{"range":{"sheetId":0,"dimension":"ROWS","startIndex":0,"endIndex":1},"inheritFromBefore":false}},{"pasteData":{"coordinate":{"sheetId":0,"rowIndex":0,"columnIndex":0},"data":"X,Y,Z","type":"PASTE_NORMAL","delimiter":","}}]} File To Send: File To Save With Output: Timeout (Seconds):30 Trust Any Certificate:Off ]
    ----------- description end ----------

    "Auth-multi" tasks is same as your "Auth", but I add some more scropes.
     

    Attached Files:

  15. inn508

    inn508 New Member

    Joined:
    Jul 28, 2016
    Messages:
    4
    Likes Received:
    1
    Sorry, I find my mistake.
    I add "alt" and "key" after POST URL.
    After I remove those query parameters, spreadsheets.batchUpdate already can work.
     
    Kishor likes this.
  16. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Awesome :)
     
  17. niyonsv

    niyonsv New Member

    Joined:
    Aug 3, 2018
    Messages:
    5
    Likes Received:
    0
    Hi Joao, I'm getting this error when opening the https://developers.google.com/oauthplayground/ page. I'm not using anything from the cloud console other than the 'Wavenet' voices. This page is saying that I'm out of quota. I haven't even completed this project. Can you please help? I'm not that familiar with Google Cloud Console.

    [​IMG]
    [​IMG]
     
    Last edited: Feb 2, 2020
  18. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hi. Maybe that was a temporary error? I'm able to use it right now...
     
    niyonsv likes this.
  19. niyonsv

    niyonsv New Member

    Joined:
    Aug 3, 2018
    Messages:
    5
    Likes Received:
    0
    Yes, it was temporary. Now I'm able to access the page. Not sure what happened. I'm a bit with my works so didn't get time to try this project. Will try and review it later. Anyways thanks for the tutorial.
     
  20. niyonsv

    niyonsv New Member

    Joined:
    Aug 3, 2018
    Messages:
    5
    Likes Received:
    0
    Wow.. I successfully did the project. Thanks Joao!! I did send some values regarding the phone and battery to the Sheets like time, battery level, SOT, etc. But now there's another issue that the value that added to the Sheets document have a ' symbol before each value that starts with number like date, time, etc. But no issue with values that starts with letters. Those values in Tasker also don't have that ' symbol.

    http://imgur.com/a/xu3TsZb
    [​IMG]
    [​IMG]
     

Share This Page