So, if you have a JSON string, it needs to save it in a ‘JSON table’ (idk how to call it), not as a string?
JSON is a STRING-BASED table. A JSON table is a JSON string. You can’t make a JSON “table”, there’s no such thing. Tables in roblox are just the way you interact with JSON. JSON is just a string which works like a table and on Roblox you can convert to a table.
So, the ability to edit JSON strings?
Just support them. Let me show you an example!
This is an example converting a Lua Table into a string.
This is an example converting FROM a JSON string. Which should be what you would be doing most.
JSONEncode() turns a table into a string;
JSONDecode() takes a string and turns it into a table.
There’s no easy way to “edit” json strings. The only thing you would need to do here is handle JSON Strings as tables. Which is not hard. If the data you got from a key is a string, doing a pcall() with a JSONDecode() should convert it.
Okay, now I understand it!
If the key’s value is a JSON string, the plugin will turn it into a table.
You can edit that table, and if you save it, it will save as a JSON string.
Not really, it will just TURN into an actual table. A JSON string is just a string table that’s it. When you turn it into a table, it’s a table now. So it would save as a table. One thing you can do is keep the data about if the data loaded was a string / json string and save it with JSONEncode() if it was
Can you add an undo button since we’re dealing with data and i actually accidentally deleted an entire table and it was devastating. (Luckily it was for something that I was able to replace the data with but still)
It prob could just use the history checkpoint thing, and u undo manually with studio (maybe)
A very good idea! I will probably add that!
[UNDO] Update:
Now you can undo the last removed key with the Undo Last Removed Key button at the top left.
[Warning] if you restart the plugin or studio, the plugin is NOT going to remember the last removed key, so you can’t undo it!
Hi, this is a really nice plugin, the UI looks great.
I have a suggestion:
- Instead of just using this for Datastore you can expand it to also create, edit and view tables that are inside a Module.
(I think that would bring a lot of value to the community as we don’t have a Table editor that is friendly to non-scripters at the moment)
Hmm… How would you imagine that?
I don’t know how should I make this.
Please send me your ideas!
This will be so helpful in the future. I always hate setting up datastores.
What you said doesn’t really make sense but ok…i don’t know how that would be implemented. It would be possible to have modules that are just a table with nothing special inside. For beginners, a easier way to understand tables is to enable the new console. It prints an actual table visually.
I could help you include ordereddatastores support if you wanted to. It’s not really complicated at all.
What “new console”??? I’ve not heard of that.
Think of Excel and Google Sheet.
It’s a Table viewer and editor, it’s the same thing as you already have, you just have to expand it to work with ModuleScripts not just for Datastores.
Okay, but it will be a different plugin I think.
Because, this is a Datastore editor.
But cool idea!
Thanks, but I think I’m starting to understand it rn!
Now I just need to find out a way to implement it into the plugin!