Need help on table.unpack

I’m trying to unpack some tables that have many tables and print them in “Fields” on Discord Webhook.
If it has only 1, it works as well.
But if it has more than one, it shows only the first, so the second didn’t show anything.
How to Fix It

Some Code :

		local function Embed_Fields(name:string, value:string, inline:boolean)
			local Fields = {name, value, inline}
			return Fields
		end

		local Final_Embed = {}
		local Final_Fields = {}
		if Setting.Device.Enable then
			table.insert(Final_Embed, Embed_Fields("Device", Device__(), true))
		end
		if Setting.RunService.Enable then
			table.insert(Final_Embed, Embed_Fields("RunService", RunService__(), true))
		end
		for i, v in pairs(Final_Embed) do
			table.insert(Final_Fields, {
				["name"] = tostring(v[1]),
				["value"] = tostring(v[2]),
				["inline"] = v[3]
			})
		end
		print("Final_Fields :", Final_Fields)
		print("table.unpack(Final_Fields) :", table.unpack(Final_Fields))

The Result :

02

table.unpack is an array exclusive function, it isn’t compatible with dictionaries, you’ll need to iterate over that table instead.

Can you show me some Example, because im 100% new for “table” also for .Lua. Thank you.

for i, v in pairs(t) do
	print(i, v)
end

‘t’ would be the table you’re trying to unpack.

i’m confused now.

I thought the intention of table.unpack was to print the table’s contents, look at the original script you provided.

print("table.unpack(Final_Fields) :", table.unpack(Final_Fields))

I just realized Final_Fields is an array of dictionaries, so what exactly is the issue?

The issue is that in the Final_Fields tables have 2 tables right but when I unpack and make it log on "Discord Webhook Fields", it shows only the first, so where is the second one?

image

Follow the image, i can print each of Final_Fields as Final_Fields [1] and Final_Fields[2], but I just want it to be automatic because it can setting that Enable or not, so I can’t predict the future.
So I need to unpack it and show all the results.