This is my table:
{"status":"success","Product1ID":{"product":"Product1ID","owns":"yes"},"Product2ID":{"product":"Product2ID","owns":"yes"}}
How can I get each table in table, and the values in each table.
This is my table:
{"status":"success","Product1ID":{"product":"Product1ID","owns":"yes"},"Product2ID":{"product":"Product2ID","owns":"yes"}}
How can I get each table in table, and the values in each table.
It looks like this is JSON (or a python dictionary)
Are you looking for JSONDecode?
(For any vanilla Lua users that happens to read this, if you’re looking to decode json, I suggest you look at here)
I have an API that returns that, but how can my roblox Lua find every value in it?
I don’t know if I misinterpreted your question or not, but what data type is the API returned?
If it’s a table, maybe a recursive pairs(table)
or next, table
can help?
Something like this:
function GetValue(table)
local result = { };
for k, v in next, table do
if type(v) == "table" then
for k, v in GetValue(v) do
result[k] = v;
end;
else
result[k] = v;
end;
end;
return result;
end;