ESODecoded

GetNumBagUsedSlots

ESO Lua API function — used by 53 of the 3,030 addons we indexed (combined 12,157,976 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.

Official signature

GetNumBagUsedSlots([Bag|#Bag] bagId)

Returns: integer usedSlots

Real usage — from CraftStore

function CS.InventorySpace(control)
  control:SetText(GetNumBagUsedSlots(1) .. '/' .. GetBagSize(1))
  if GetBagSize(1) ==  GetNumBagUsedSlots(1) then

Short excerpt from the shipping addon CraftStoreits ESOUI page; the code belongs to its author. Shown because documentation without a working example is half a reference.

Most-downloaded addons using it

AddonTotal downloads
CraftStore5,176,147
Inventory Insight2,763,446
Azurah - Interface Enhanced1,462,318
Wykkyd Toolbar567,448
Info Panel368,274
Group Loot Notifier363,639