Example: Google Sheets NPM

Hi @Yisrael (Wix) , @Gal Morad . I also have an issue with “Get Code” Button. The link to the site: Do you have any ideas? Thanks.

Can you elaborate about the problem?

Hi Gal,

Google Drive API Enabled. Config file is downloaded, the text is copied and inserted in the first input slot, enter passed.Then I have created an excel sheet in my google account. The link is inserted in the second field. After this the ‘Get Code’ button still doesn’t seem to work.
I have noticed that in the config.jsw file, there is an error " require is not defined". Just in case, I have reinstalled googleapis module. As per another forum discussion, “require” error is not causing any problems. So, I cannot understand where is the issue.

At the google console there are Google drive API , and google sheet API. The first one ( API key 1) is not used. The googlesheet API Auth client is copied from the downloaded Json file (step 1 above).

Ok, thanks. Do you have an idea why “Save” button is not responding?

If I remember correctly , your screenshot did not have green V icon near the input fields, try to push “enter” after each copy paste, make sure you have a green V icon before you click the “Get Code” button.

Hi @yisrael-wix

Awesome !! creativity.

Can you please help me resolving below issue :

I am getting error “Cannot read property ‘installed’ of null”

TypeError: Cannot read property ‘installed’ of null
TypeError: Cannot read property ‘installed’ of null
Cannot read property ‘installed’ of null common-googleSheet.jswLine 29

The error you are getting indicates that the query did not retrieve your configuration data from the config database collection. Did you follow the steps on the Configuration page?

Hi, I need to create a dynamic chart from my database with filters. I tried ( https://www.vorbly.com/Vorbly-Code/WIX-IFRAME-GRAPHS-%26-CHARTS-WITH-FILTERS ) but that’s not working for some reason. Please help.

You should contact folks at vorbly for assistance.

@yisrael-wix already did but they haven’t responded yet and this is urgent so I was hoping someone would know how to implement this with a similar or different approach

This is great! Thank you for this. I have successfully gotten my data from Wix into a Google Sheet. I have two waivers that I have the user check off. When they submit the form I get the full “Media Waiver” instead of a simple checkbox in Google Sheets, whereas in the Wix Database, I see checkmarks. Small thing, but since I have other admins checking the spreadsheet, I’d love to replace the words “Media Waiver” with just a simple :heavy_check_mark:. Thanks for the help!

And I figured it out - it’s the value in Wix settings for the checkbox itself. Thanks!

@gal-morad After this depreciation, will your current code still work?

@shantanukumar847 The example has been updated.

@gal-morad can you tell me what I would need to change in the code example to have Google Sheets send the data into Wix rather than the other way around? Thank you!

@garymstark This is a totally different scenario, you will need to read the data using google api
https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values
A nd feed it into WIX element, like repeater for example.

IF you need just a simple table without fancy design and no code, you can use the table master app for that.
https://www.wix.com/app-market/table-master/overview

@gal-morad Thank you! Table Master looks cool, but I need to feed my data into a dynamic table, so I’m not sure that will work. 2 follow ups…

  1. I have a database titled “DemoGoogleSpreadsheet” and a backend database titled http://functions.js with the following code that I am trying to use to set up Zapier to “fire off a single Post request as JSON”.

I’m using the following URL: https://garymstark.wixsite.com/website-4/_functions/storerecords and I keep getting a (500) server error message. Any thoughts on how to fix this?

‘use strict’;
import wixData from ‘wix-data’;
import {ok, response} from ‘wix-http-functions’;

export function post_storerecords(request) {

return request.body.json ()
.then (body => {

let recordInsert = {
“title”: body.Headline,
“description”: body.Description,
“imageUrl”: body.ImageUrl,
“linkButtonText”: body.LinkButtonText,
“linkButtonUrl”: body.LinkButtonUrl,
“authorName”: body.AuthorName,
“email”: body.EMail
};

return wixData.insert (‘DemoGoogleSpreadSheet’, recordInsert)
.then(result => ok({body: JSON.stringify(result)}))
. catch (err => response({status: 500, body: err}));
}
);
}

  1. I see that Wix has an Airtable node module. I LOVE the plug and play template you showed to get the Google Sheets node module up and running. Is there a template available to get the Airtable node module working as well?

Thank you for all of your help!

Hi, can someone please help me get started with this? I am fairly tech savvy but a js code newbie. When I open the example everything appears to work and I can put in the data for the first two fields and get checkmarks, but the “Get Code” button never gets enabled. What am I doing wrong? Thanks! Barbara

As I recall, I think you may need to be in the live site for it to work. Click publish/view live site and see if that works.I’m not in front of my computer, but give that a shot.

@yisrael-wix
@leopoldtaylor - You were having the same problem right?

Why isn’t the get code button clickable? /I have also attached the error from chrome developer.