Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon Alexa reading Google Spreadsheets

I got interested in customizing the Amazon Alexa reading Google Sheet. I tried to create codes to enable some of the Alexa functions such as read, edit and list but I was not able to complete and run the output properly.

I have the code in separate working chunks. I tried to use the Alexa Node JS and Google Node JS. Do you think it is possible to combine them together and get it working? I would like to ask for help since I am stuck for in this for months already.

For the Alexa:

'use strict';

var Alexa = require("alexa-sdk");

exports.handler = function(event, context, callback) {
    var alexa = Alexa.handler(event, context);
    alexa.registerHandlers(handlers);
    alexa.execute();
};

var handlers = {
    'ReadFileIntent': function () {
        console.log ('In Read File Request')
        this.emit(':tell', 'Read');
    },
    'LaunchRequest': function () {
        console.log ('In Launch Request')
        this.emit(':tell', 'SayHello');
    }
};

For the Google, I followed the below link for a step by step guide https://developers.google.com/sheets/api/quickstart/nodejs

like image 756
Kiralancer Avatar asked Sep 13 '26 10:09

Kiralancer


1 Answers

There are two options how you can access content from a Google Spreadsheet:

  • Using a public spreadsheet: If you set your sheet to public, you can access the content through a JSON endpoint by just using the spreadsheet ID and the position of the sheet you're trying to access: https://spreadsheets.google.com/feeds/list/${spreadsheetId}/${sheetPosition}/public/values?alt=json
  • Using a private spreadsheet: This is a little more complicated, as you need to do authentication and use the Google Sheets API

The Jovo Framework for Alexa Skills and Google Actions offers a Google Spreadsheets CMS integration that does all the unnecessary work for you. It offers different sheet types so you can access content in the way you prefer and don't need to do the parsing yourself. You can find a step-by-step tutorial and video here: Tutorial: Use Google Sheets as CMS for your Voice App.

like image 128
Jan König Avatar answered Sep 15 '26 02:09

Jan König



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!