How do we use excel as a database for Roblox?

So I was wondering how can we use Microsoft excel for a database. Can someone explain to me how we can use it? Is it like this:

local httpservice = game.HttpService

local data = {
["data"] = playerdata
}
local encoded = httpservice:JSONEncode(data)

httpservice:PostAsync(url,encoded)

If this is not how it works, can someone explain it?

You could use any one of the cloud providers to host an API that uses Excel as a backing store. For that your API would either use the Office SDK to open an Excel file and read the data. Another option if your Excel file were in the .docx format would be to open it as if it were an XML document and read/write data using components in the back end framework. Neither of which are going to be quick.

I have to wonder why you would want to do this though, given Roblox already has a simple data storage feature and there are a plethora of services that would provide better and faster options, often for free. Google Firebase is a great free (unless you usage exceeds pretty generous limits) set of services including storage of unstructured data.

EDIT: Yes if you do go down the API route you would use the HttpService to call the APIs.

Thanks for explaining it to me. But I have a question. How would we send data to excel?

Why not just use a datastore instead?

I would use a datastore, but I just want to test if it will work. And I really need an answer to my question.

You would have to send the data to an API that would open the Excel file and write data into it using the Office SDK or via XML. Both of which require you to understand and code for the internal structure of Excel.

Unless of course you are thinking of an export feature, in which case you could generate data as a CSV file that users could open in Excel.

So does it go like this?

local data = {
["FileName"] = {
["address"] = playerdata
}
}

data = httpservice:JSONEncode(data)

The short answer is it depends on how you want to store it in Excel. At the moment your requirements are very vague. To provide more detailed help you would need to provide a more detailed explanation of what you want to store and how you want it to appear in Excel.

But I would still ask why you want to use Excel, not only is it going to be complex to do it is going to be very SLOOOOOOOWWWWWW!!! and affect the performance of any game that uses this approach.

But how would we make the dictionary then? Is it like:

local data = {
["sheetnamehere"] = {
["address"] = playerdata
}
}

I would advise against writing to excel as your primary DataBase in 2021. If you’re interested in it as a backup data source or to just learn, it may be reasonable.

I have a few old games that do this, and the data has stood the test of time. This tutorial from woot3 is more or less how I handled it. Note that the module provided is no longer supported.

The biggest thing you’re likely going to run into is that Google Sheets has infinitely harsher quotas than DataStoreService. Any game that scales players heavily will almost certainly hit this quota resulting in data failure - where a certain amount of retries is just adding pointlessly to the stack.

that is what i meant. sorry for wording it badly. I would like to know how to make the dictionary for sending the data. Is it like this

local data = {
["FILE_NAME_HERE"] = {
["cell_address"] = playerdata
}
}

How you structure the data is entirely up to you as you would have to transform it into the tabular format required by spreadsheets. You would most likely send the data as a JSON object as in your examples, but then in your API you would need to write code that maps that to rows and columns. There are potentially some utilities that can transform JSON to tabular data depending on what framework you used for your API, and the documentation would tell you how to structure the JSON.

Like I said without some more detail of what the data you want to put in a spreadsheet looks like in the game and how you want it to end up in a spreadsheet it is hard to help you anymore. There is no magic structure for your dictionary that would end up in a spreadsheet without some coding to transform it.

Can you just tell me more about the dictionary part. I really need an answer to this. Does it go like:

local data = {
["filename"] = {
["cell_address"] = playerdata
}
}
data = httpservice:JSONEncode(data)
1 Like

I’m sorry I can’t help you anymore you clearly aren’t understanding what I have already explained.

Sorry for bumping onto this rather old topic, but you didn’t help OP in getting the answer to his question. What he meant was that Excel has rows and columns, and when they intersect, they form a cell with a unique address. He wanted to save that data to a certain cell using HTTPService , but he didn’t know how to save it to a cell with a unique address. Now I think he meant accessing Excel through the website, not the system files.