I need to get feedback to return from outside of a bindablefunction

So I have this bindable function:

AddGridItemBF.OnInvoke = function(plr,SizeX,SizeY,Image, itemFrame)
	local chr = plr.Character or plr.CharacterAdded:Wait()

	local config = Instance.new("Configuration")
	config.Name = SizeX.."x"..SizeY

	local InvPosX = Instance.new("IntValue")
	InvPosX.Name = "InvPosX"
	InvPosX.Value = 0
	InvPosX.Parent = config

	local InvPosY = Instance.new("IntValue")
	InvPosY.Name = "InvPosY"
	InvPosY.Value = 0
	InvPosY.Parent = config

	local InvSizeX = Instance.new("IntValue")
	InvSizeX.Name = "InvSizeX"
	InvSizeX.Value = SizeX
	InvSizeX.Parent = config

	local InvSizeY = Instance.new("IntValue")
	InvSizeY.Name = "InvSizeY"
	InvSizeY.Value = SizeY
	InvSizeY.Parent = config

	local ImageVal = Instance.new("StringValue")
	ImageVal.Name = "Image"
	ImageVal.Value = Image
	ImageVal.Parent = config

	config.Parent = replicatedStorage["ItemsInGrid"]
	
	reloadItems()
end

fired from this part of a modulescript: (module is basically an item type that can be placed into the grid)

	if Item["IsModule"] then
		local Name = Item["Name"]
		local Amount = Item["Amount"]
		local Image = rbxassetid .. Item["Image"]
		local SizeX = Item["SizeX"]
		local SizeY = Item["SizeY"]
		local EffectFunction = Item["EffectFunction"]
		
		local existingTemplate = scrollingFrame:FindFirstChild(Name)

		if existingTemplate then
			module.CurrentInvItems[Name]["Amount"] += Amount
			itemTemplate:Destroy()
			existingTemplate.AmountLabel.Text = "x"..removeLetters(existingTemplate.AmountLabel.Text) + Amount
			
			existingTemplate.ImageButton.MouseButton1Down:Connect(function()
				AddGridItemBF:Invoke(plr,SizeX,SizeY,Image,itemTemplate) --or alternatively here
			end)
		else
			module.CurrentInvItems[Name] = Item
			itemTemplate.Name = Name
			tempImageButton.Image = Image
			tempNameLabel.Text = Name
			tempAmountLabel.Text = "x"..removeLetters(tempAmountLabel.Text) + Amount
			
			tempImageButton.MouseButton1Down:Connect(function()
				AddGridItemBF:Invoke(plr,SizeX,SizeY,Image,itemTemplate) --here
			end)
		end
	end

And whenever any change occurs to the new item that is created after “config” is read to create an item in the grid inventory, I need to also get feedback to the script where its fired from. Ive also posted about aforementioned grid inventory before (the post).

How would I detect that the source of a grid item is this bindable function and get data back to the script it was originally fired from?

You are able to return values to scripts that invoke BindableFunctions/RemoteFunctions. I can’t give you a specific example, as I don’t really know what you’re asking for, so here is a general case:

Script 1:

-- Script 1:
local BindableFunction = path.to.BindableFunction

local Secret = BindableFunction:Invoke() -- Yields until a value is returned or scope ends (will return nil in that case)

print(Secret) -- Will print "There is no secret!" (See Script 2 below)

Script 2:

-- Script 2:
local BindableFunction = path.to.BindableFunction

BindableFunction.OnInvoke = function()
    return "There is no secret!" -- Return this value to the script that invoked the event
end

No, I mean from an outside script that checks when something happens I would want to be able to detect if a “grid item” originated from that specific bindable function. Problem being the config which is created inside the binded function isnt what i need feedback on, its only when the config is translated into a grid item and can have things happen to it.