Returns the value of a global variable. Often used in the default UI in cases where several similar names are systematically constructed. Examples:

  • In a script attached to a frame template, getglobal(self:GetName().."Icon") can refer to the Texture whose name is defined in XML as $parentIcon.

  • Several sets of localized string tokens follow standard formats: e.g. getglobal("ITEM_QUALITY"..quality.."_DESC) returns the name for the numeric quality.

Equivalent to or _G["name"].

See also Utility functions.


value = getglobal("name")


  • name - Name of a global variable (string)


  • value - Value of the given variable (value)
This function is defined by the default user interface in Lua. You can find the definition by examining the FrameXML code for the default UI,