> For the complete documentation index, see [llms.txt](https://nviasoft.gitbook.io/nviasoft-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nviasoft.gitbook.io/nviasoft-docs/api-reference/item-parsing/finditem.md).

# FindItem

### int FindItem(int lMsgId, string sItemName, ref string\[] arrItemValue, ref int nItemCount)

Format파일에 정의된 이름을 통해 sITemName에 넣으면 그 이름을 기준으로 해당 아이템 전체 값과 수량을 리턴합니다.

{% hint style="info" %}

* 상황: S2F23 메시지의 특정 항목을 Format.SML 파일에 TRID라는 이름으로 매핑해 둔 경우.
* 동작: sItemName에 "TRID"를 입력하면, 라이브러리가 메시지 내부에서 해당 정의와 일치하는 데이터를 자동으로 찾아냅니다.
  {% endhint %}

Parameters

<table data-header-hidden><thead><tr><th width="183"></th><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>항목</strong></td><td><strong>데이터 예시</strong></td><td><strong>설명</strong></td></tr><tr><td>sItemName</td><td>"TRID"</td><td>Format 파일에 정의된 검색 키워드</td></tr><tr><td>arrItemValue</td><td>["12345"]</td><td>(ref) 실제 TRID 값이 담긴 배열</td></tr><tr><td>nItemCount</td><td>1</td><td>(ref) 검색된 아이템의 수량</td></tr></tbody></table>

```csharp
void SearchDataByName(int lMsgId)
{
    string[] foundValues = null;
    int count = 0;

    // "TRID"라는 이름을 가진 아이템을 모두 찾음
    int result = m_gem.FindItem(lMsgId, "TRID", ref foundValues, ref count);

    if (result >= 0 && count > 0)
    {
        Console.WriteLine($"'TRID'를 {count}개 찾았습니다.");
        foreach (string val in foundValues)
        {
            Console.WriteLine($"값: {val}");
        }
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nviasoft.gitbook.io/nviasoft-docs/api-reference/item-parsing/finditem.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
