Node.js Google Sheet
You might have seen this in another forum, but I'm trying to aim this differently with the question.
So i've built a CEP based on this tutorial (Note this is for testing, so my actual plugin will be integrated)
https://medium.com/adobetech/how-to-build-a-node-js-server-in-a-panel-ba1d63ea67e2
Currently I open my plugin (index.html)
I have a sign in button
portion from index.html
<button id="sign-in">sign in</button>
This contacts my index.js
portion from index.js
var signButton = document.querySelector("#sign-in");
signButton.addEventListener("click", signIn);
function signIn(){
csInterface.openURLInDefaultBrowser("http://localhost:3200/localServer.html");
}
this opens up a browser to sign into google api, but once accessed it remains in the browser like so. The actual localServer.html doesn't update that is in my folder.
portion from localServer.html (This is portion that finds the bits and put it into the pre tag)
<pre id="content" style="white-space: pre-wrap;">TRY THIS</pre>
function listMajors() {
gapi.client.sheets.spreadsheets.values.get({
spreadsheetId: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms',
range: 'Class Data!A2:E',
}).then(function(response) {
var para = appendPre(JSON.stringify(response.result.values[0]));
//alert(response.result.values[1][0]);
}, function(response) {
appendPre('Error: ' + response.result.error.message);
});
}
Can anyone suggest either an easier way to pull the data in my index.html or index.js or communicate the data back into my index.html or index.js from the browser imaged above.
I can't believe I can get all this data and information, yet I can't pass it to use.
Incase anyone is thinking why I need to do it this way and not using a public Google Sheet.
My plugin, launches a script. this then takes the Google Sheet rows one at a time. Duplicates the comp, changes the data based on the rows. This is where I need to have the Google API Oauth signed in. It then updates the Column specified from Ready to Done.
I've done tests on a local WebServer on mac that does all this great, then I put it into my plugin, The plugin in doesn't allow me to login in the panel, which then lead me to launch it in a web browser and send back the data, but now I can communicate back the data. So anyone who has done this or has any ideas would be appreciated.

