Module for Google Sheets

Hello everyone, I was looking for how to get information from Google Sheets for a self-updating LocalizationTable and decided to share it, information taken from this video:


How to use

  1. You create or open a file in Google Sheets.
  2. You press Share and in change you press Anyone with the link.
  3. Copy link, and you go to Roblox, remember to allow HTTPS requests.
  4. Download the module or get it by its asset id and in a script write the following:
local GoogleSheets = require(path.to.GoogleSheets) -- or require(7392092163)
local GST = GoogleSheets.new(Document, Page)
-- Document: id of the document.	Page: id of the page
Get Document id and Page id
URL = "https://docs.google.com/spreadsheets/d/1nj6oilCFIXZAVvifsu7UrfLJ3yLiwVwx1FOZivGvUw4/edit#gid=163593929"
Document = "1nj6oilCFIXZAVvifsu7UrfLJ3yLiwVwx1FOZivGvUw4"
Page = "163593929"

  1. Call the methods!

About

Current methods

GetByCell

  • Parameters:: Letter: string, Number: number
  • Description: Obtains the content of the document by the cols(Letter) and its row(Number)
  • Return: string?
  • Example:
local GoogleSheets = require(7392092163)
local GST = GoogleSheets.new(Document, Page)
print(GST:GetByCell("A", 1)) -- hello
print(GST:GetByCell("B", 1)) -- nil

image


Update

  • Parameters:: none
  • Description: update module information
  • Return: void or nothing


Thanks for reading.
Module, Source code

18 Likes

I don’t understand the the GoogleSheet.new() part. Could you explain it differently please?

Of course, GoogleSheet.new() is the module base, from this you can use the methods:

The URL needed by the module is split like this


and to use it is like this

local GST = GoogleSheets.new("1nj6oilCFIXZAVvifsu7UrfLJ3yLiwVwx1FOZivGvUw4", "163593929")

with that, the module will build the URL to get the data.

1 Like

I have been looking for a way to do this for the past 5 hours, now lets hope this works!

1 Like

So is it work? Let me know your result

You can try it yourself to see if it works or not.

It does, it is very picky and not very good for large scale. But it it does work.

2 Likes

Thank you for reply!! It’s really helpfull information.

1 Like

That’s great, but how can I change the information in the google table using this module? :slight_smile:

1 Like