How to use string.format to keep text updated

I have my dialogue system, and it works great, but I want to be able to send updated values. On my previous game I did something like this

local FishSale = 0

GetArguments = function()
			return {FishSale}
		end,
Messages = {
			[1] = {
				Msg = "Hello!<Yield=0.5> What can I help you with?",
				Choices = {
					[1] = {Answer = "I want to sell my fish! 🐟", NextQuery = 2},
				}
			},
			-- Sell fish
			[2] = function() 
				FishSale = SellFish:InvokeServer()
				
				return 3
			end,
			[3] = {
				Msg = "You have sold all your fish for %s"
			},
}
local GetArguments = dialogueData.GetArguments ~= nil and dialogueData.GetArguments() or {}
local TotalMessages = dialogueData.Messages[NextSpeech]

if type(TotalMessages) == "table" then -- Normal dialogue
	local Text = string.format(TotalMessages.Msg, table.unpack(GetArguments))

and the %s would input the FishSale, because if I just did … FishSale …, it would print 0, even tho it should update cause of the invoke. So I had to use this format system to implement it. However, I’m not entirely sure how or why it works? I wanna be able to store multiple items inside the table, and that way they update constantly, as my player can change their name and if I just do PlayerData.DisplayName.Value inside the string, it’ll just get whatever it was when the module was required, and so I need to input some way of getting the updated version

GetArguments = function()
		return {
			PlayerData.DisplayName.Value,
			PlayerData.FavoriteColor.Value
		}
	end,

Problem is when I do %s it only returns the DisplayName.Value. How can I seperate so I can get both?

local a1, b2 = "1", "2"

local function returnAB()
	return a1, b2
end

local a2, b2 = returnAB()
print(a2, b2)

Instead of returning a table of values you can return a tuple of values (multiple comma separated values), like in the above.

Applied to your example that would look like.

returnVal1, returnVal2 = function()
	return PlayerData.DisplayName.Value, PlayerData.FavoriteColor.Value
end

local Text = string.format("%s %s", returnVal1, returnVal2)