I am trying to make an application form game. Right now I am to the point where I have answers to questions stored in a folder (workspace.info.answers). I am going to take the answers, put them into a table which is named as their username. I'm just clueless on how to make the table named as their username, then put it into the 'keep' table.
local function onCompleteAppFired(player)
print("submit pressed")
local name = player.Name
local keep = game:GetService('DataStoreService'):GetDataStore('keep'):GetAsync('table') print(keep) --load 'keep'
local Q1A = workspace.info.answers.Q1A
local Q2A = workspace.info.answers.Q2A
local Q3A = workspace.info.answers.Q3A
local Q4A = workspace.info.answers.Q4A
local Q5A = workspace.info.answers.Q5A
(name) = { --make a table named as the players username
"Q1A" = (Q1A.Value),
"Q2A" = (Q2A.Value),
"Q3A" = (Q3A.Value),
"Q4A" = (Q4A.Value),
"Q5A" = (Q5A.Value)
}
keep.(name) = (name) --add the tabel to 'keep'
DataStoreService:GetDataStore('keep'):SetAsync('table',keep) --save 'keep'
end
This function is running, as I am getting "submit pressed" in the output.

4 comments
Remove the parentheses, and for keep.(Name), it’s keep[name].
But why though? What is wrong with nested tables? i.e. playersAnswers[player][Q1A] = Q1A.Value
@sleazel , I did 'keep[player.Name][Q1A] = Q1A.Value' for each Q, and I got error: ServerScriptService.remoteevents:25: attempt to index field '?' (a nil value)
My fault, try the answer below. You can access data this way once it is created..