Adding Table to dictionary

I wanna add another table to a pre-existing dictionary. I’ve figured out how to add another table but then it removes the past tables.

I’ve tried this

local datatoupdate= {
			["fields"] = {
				["Golds"] = {
					["integerValue"] = "25",
				},
				["Banned"] = {
					["booleanValue"] = false,
				}
			}
		}

datatoupdate["fields"] = {datatoupdate["fields"], ["Testing"] = "Hello"}

problem is that it just a dictionary inside dictionary with a table I want just a dictionary with tables.

Not sure if I explained it well but we will see.

Thanks for any help in advance.

Couldn’t you do this?

datatoupdate["fields"]["Testing"] = {"Hello"}

Or this:

table.insert(datatoupdate["fields"], Testing)

Brilliant thanks, I knew this was a simple problem just my head is not working today. Thanks for the help I’ll select this as the solution.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.