[Fixed] Trello API Error

Hello there,
I am trying to make a system, which it will clone Trello Data Cards to a roblox GUI.

The script:

local trello = require(script.TrelloAPI)
local config = require(script.Config)
local boardId = trello:GetBoardID(config.Board)
local sessionlist = trello:GetListID(config.List, boardId)
local template = script:WaitForChild("SessionPage")
local scroller = game.StarterGui.Sessions.Main.SessionsPage:WaitForChild('SessionPage')

	
while true do
	local sessions = trello:GetCardsInList(sessionlist)
	for _,session in pairs(sessions) do
		print("test.")
				if session.desc == "" then
				else
				local templateClone = template:Clone()
				print("test!")
				templateClone.HostLabel.Text = session.desc
				templateClone.SessionDayLabel.Text = session.name
				templateClone.TimeLabel.Text = "Time coming soon!"
				templateClone.Parent = scroller
				scroller.CanvasSize = UDim2.new(0, 0, 0, scroller.UIListLayout.AbsoluteContentSize.Y)
				print("test..")
			end
		end
	end

I tried to use print to see where my error was, but they print alright.
I have used this Trello API script for bans and it worked.

My Issue:
It does not create the GUI card.

If you have any idea, please write below!

Thanks,
@PixelBytezz

Try printing out sessions and session to see what value they have, to help further diagnose the issue

You’re parenting the templateClones to the ScrollingFrame which is a descendant of StarterGui, when I think you meant to parent it to a descendant of a player’s PlayerGui.

If you mess with the descendants of the StarterGui folder, those changes will only display for a client when they reset their character (or only if they rejoin the server if the changes were in a descendant of a ScreenGui with the ResetOnSpawn property set to false).

Give the docs I linked a read, and you should be able to work on a fix with the info!

Sorry for not making it clear; I am not using a ScreenGui for this project. I am using a Surface Gui which is Adorneed to a Screen.

So after I did some edits to the code:

local trello = require(script.TrelloAPI)
local config = require(script.Config)
local boardId = trello:GetBoardID(config.Board)
local sessionlist = trello:GetListID(config.List, boardId)
local template = script:WaitForChild("SessionPage")
local scroller = game.StarterGui.Sessions.Main.SessionsPage:WaitForChild('SessionPage')


while true do
	local sessions = trello:GetCardsInList(sessionlist)
	for _,session in pairs(sessions) do
		
		local templateClone = template:Clone()
		if session.desc == " " then
			templateClone.HostLabel.Text = "Host: N/A"
			templateClone.SessionDayLabel.Text = session.name
			templateClone.TimeLabel.Text = "Time coming soon!"
			templateClone.Parent = scroller
			scroller.CanvasSize = UDim2.new(0, 0, 0, scroller.UIListLayout.AbsoluteContentSize.Y)
			
		else
			templateClone.HostLabel.Text = session.desc
			templateClone.SessionDayLabel.Text = session.name
			templateClone.TimeLabel.Text = "Time coming soon!"
			templateClone.Parent = scroller
			scroller.CanvasSize = UDim2.new(0, 0, 0, scroller.UIListLayout.AbsoluteContentSize.Y)
		end
		
	end
end

It seems like when I first join it doesn’t show up, but when I reset my character everything loaded. Although now I have a new issue:

Everything is getting spammed…
image

Is there a way to prevent that from happening? And for the temples to show when the player joins and not when they reset their character?

1 Like

Not using an unweilding While true loop will prevent the spam…

I was using a while true loop so it updates everytime I add a new card in Trello.

If I remove the loop, the spam stops but it doesn’t update.

Try moving the SurfaceGui out of StarterGui, I did some testing and it seems to have an effect on the board not updating.

As for everything being spammed, you can remove all the children of the ScrollingFrame before adding all the sessions (make sure to add a check for what class the child is before removing, so you dont remove something important such as the UIListLayout).

Ok:
Keep the while true loop, but add a task.wait(60) into it so it doesn’t spam. Also have it remove the current children of the scrollingframe each cycle so they don’t double up

Alright, so I changed the SurfaceGui’s Parent to the Workspace Screen.

I now also have only the UIListLayout :
image

And although it shows the cards great once the player spawns without needing to reset, it does not update.

Alright, I will test it right now!

I used:

task.wait(60)
	local c = scroller:GetChildren(CFrame)
	for i = 1,#c do
		if c[i].Name == "SessionPage" then
			c[i]:Destroy()
		end
	end

It works! But is there a smoother way for it to update?

Thank you so much @PoppyandNeivaarecute & @CursorDance for helping me find a solution to my problem!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.