Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why do some values print but others dont?

I'm using the Roblox Trello API to get some values from my Trello board. I'm using an enhanced for loop and putting in the TrelloAPI:GetCardsInList() function which returns a table. Inside that table, there are multiple cards and those cards have different values. The values I need however are name and desc. My code and output are below. Can anyone tell me why it prints some but the other's return ""?

for i, v in pairs(trelloApi:GetCardsInList(ListID)) do
	if v.name == "Host" then
		print(v.desc)
	elseif v.name == "Date" then
		print(v.desc)
	elseif v.name == "Time" then
		print(v.desc)
	elseif v.name == "CheckIn" then
		print(v.desc)
	elseif v.name == "Departure" then
		print(v.desc)
	elseif v.Name == "Slock" then
		print(v.desc)
	elseif v.Name == "Destination" then
		print(v.desc)
	elseif v.Name == "FN" then
		print(v.desc)
	elseif v.Name == "Boarding" then
		print(v.desc)
	end
end

Output:

Image Link

If you want to contact me, please do on discord at ArchiPlaysPro#2209

2 comments

0

print v.name at first line in the loop, and show screenshot of that

0

oh i found it

2 answers

✓ Accepted answer

in the beginning you write v.name but at the end you wrote v.Name its capital sensitive, name it lower capital n

1 comment

0

LMAOOOO I'm SO DUMB I've BEEN STUCK WITH THIS ISSUE FOR DAYS NOW. TYSM UR EPIC GAMER

I know why. You forgot to make a variable.

This is yours.

for i, v in pairs(trelloApi:GetCardsInList(ListID)) do
    if v.name == "Host" then
        print(v.desc)
    elseif v.name == "Date" then
        print(v.desc)
    elseif v.name == "Time" then
        print(v.desc)
    elseif v.name == "CheckIn" then
        print(v.desc)
    elseif v.name == "Departure" then
        print(v.desc)
    elseif v.Name == "Slock" then
        print(v.desc)
    elseif v.Name == "Destination" then
        print(v.desc)
    elseif v.Name == "FN" then
        print(v.desc)
    elseif v.Name == "Boarding" then
        print(v.desc)
    end
   end

This is what it should be.

v.desc = ???
for i, v in pairs(trelloApi:GetCardsInList(ListID)) do
    if v.name == "Host" then
        print(v.desc)
    elseif v.name == "Date" then
        print(v.desc)
    elseif v.name == "Time" then
        print(v.desc)
    elseif v.name == "CheckIn" then
        print(v.desc)
    elseif v.name == "Departure" then
        print(v.desc)
    elseif v.Name == "Slock" then
        print(v.desc)
    elseif v.Name == "Destination" then
        print(v.desc)
    elseif v.Name == "FN" then
        print(v.desc)
    elseif v.Name == "Boarding" then
        print(v.desc)
    end
   end

That 'v.desc' variable, ??? is for you to make it, the questions marks it for where you write what it means. It doesn't know what 'v.desc' means.

2 comments

0

I'm using the trello API. V is clearly defined in the for loop. And it's getting the host, date, time values from v.desc but it's not getting like slock, and stuff

0

bruh v is a dictionary

This discussion is preserved as it was. New answers, comments, and votes are closed.