# Javascript: BarcodeCollection.getItemByName Method

> Gets the barcode with the specified name.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: BarcodeCollection.getItemByName Method
- **392 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/barcodecollection/getitembyname-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/barcodecollection/getitembyname-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/barcodecollection/getitembyname-method/llms-full.txt

---

### Description

Gets the barcode with the specified name.

### Syntax

```javascript
<void> BarcodeCollection.getItemByName(<RequestBarcodeFrameCallback> callback, [<ErrorCallback> errorCallback], <string> name)
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the requested barcode or null if no barcode with the specified name exists. |
| errorCallback | Optional. Is called when the operation failed with an error. |
| name | The barcode's name. |

### Examples

The following example demonstrates `BarcodeCollection.getItemByName` in a practical document-editing workflow. It gets the barcode with the specified name.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.barcodes.getItemByName(
    function(barcodeFrame) {
        if (!barcodeFrame) {
            console.warn("No barcode frame was returned.");
            return;
        }
        
        console.log("get item by name result:", barcodeFrame);
    },
    onTxError,
    "QuarterlyReport"
);
```

---

## Nearby

- **Previous:** [Javascript: BarcodeCollection.getItem Method](https://docs.textcontrol.com/ds-server/reference/javascript/barcodecollection/getitem-method/llms-full.txt)
- **Next:** [Javascript: BarcodeCollection.remove Method](https://docs.textcontrol.com/ds-server/reference/javascript/barcodecollection/remove-method/llms-full.txt)
