Clone TextLabel for every item in table

for i, v in pairs(datatable) do
CloneText:Clone()
CloneText.Parent = script.Parent.Parent.StarterGui.ScreenGui.FrameE.FrameC.ScrollingFrame
CloneText.Text = v
end

Datatable has multiple entries in it, however when a player is added it only picks one of the items in the table and clones 1 text label instead of cloning a textlabel for each item in the table.

Expected Result: Clones 5 Text labels (theres 5 things in the table)

Why is it only cloning 1 text label

You aren’t setting the position, can that be the error?

Don’t use StarterGui for this purpose.
You can either use Player.PlayerGui or access that ScrollingFrame with how many .Parent's that are required.

Also, could we see the entire code?

No that would not be an error. The position was already set when I put the text-label into Replicated Storage

local RepStorage = game.ReplicatedStorage.Remotes
local DataStore = game:GetService(“DataStoreService”)
local Data = DataStore:GetDataStore(“DataInputSaves”)
local datatable = {}
local CloneText = game.ReplicatedStorage.UIClones.TextLabel

game.Players.PlayerAdded:Connect(function(plr)
datatable = Data:GetAsync(plr.UserId)
for i, v in pairs(datatable) do
CloneText:Clone()
CloneText.Parent = script.Parent.Parent.StarterGui.ScreenGui.FrameE.FrameC.ScrollingFrame
CloneText.Text = v
end
end)

I fixed it,
CloneText.Parent = plr.PlayerGui.ScreenGui.FrameE.FrameC.ScrollingFrame

Well, they can still be stakced ontop of eachother as you are not changing the position.

Theres a UIListLayout, the position gets set below the text-label before it.

Also use a pcall when you get the datatable.

And add a print after getting the data and make sure you have multiple entries in the datatable

Already made a print, and checked before hand. I just deleted it from the script to show you guys. I need help with cloning the text-label though for each entry

game.Players.PlayerAdded:Connect(function(plr)

datatable = Data:GetAsync(plr.UserId)

for i, v in pairs(datatable) do
local CloneText = game.ReplicatedStorage.UIClones.TextLabel:Clone()
print(i..": "..v)
CloneText.Parent = script.Parent.Parent.StarterGui.ScreenGui.FrameE.FrameC.ScrollingFrame
CloneText.Text = i..": "..v
CloneText.Name = i
end


end)

Fixed it myself guys