> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get item by name

> Returns the first item found in the player's self inventory by name (order not guaranteed).

Returns the first item found in the player's self inventory by name (order not guaranteed).

<CodeGroup>
  ```lua Export theme={null}
  exports['jaksam_inventory']:getItemByName(itemName)
  ```

  ```lua Example theme={null}
  local item, slotId = exports['jaksam_inventory']:getItemByName('weapon_advancedrifle')

  print(json.encode(item, {indent = true}), "SLOT ID: " .. slotId)
  --[[
  {
      "name": "weapon_advancedrifle",
      "metadata": {
          "serial": "TSK-24895-LFN"
      },
      "amount": 1
  }
  SLOT ID: 1
  ]]
  ```
</CodeGroup>

### Parameters

None.

### Return value

| Name     | Data Type | Description                                            |
| -------- | --------- | ------------------------------------------------------ |
| `item`   | table     | The item found in the player's self inventory          |
| `slotId` | number    | The slot ID of the item in the player's self inventory |


## Related topics

- [Get items by name](/jaksam-inventory/functions/server/get-items-by-name.md)
- [Get item by name](/jaksam-inventory/functions/server/get-item-by-name.md)
- [Server](/jaksam-inventory/functions/server/index.md)
- [Client](/jaksam-inventory/functions/client/index.md)
