> For the complete documentation index, see [llms.txt](https://swonh.gitbook.io/sdmp-user-manual-eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swonh.gitbook.io/sdmp-user-manual-eng/data-handling/retriving-data.md).

# Retriving Data

Describes how to retrieve loaded data

### Get input data table

You can get a data table loaded through the `InputManager` and retrieve the rows of data contained in the table. The code example below imports a data table corresponding to a data file named SampleData and retrieves the data.

```csharp
InputTable sampleData = InputManager.Instance.GetInput("SampleData");
foreach (SampleData data in sampleData.Rows()) 
{
    int col1 = data.COL_1;
    int col2 = data.COL_2;
}
```

### Retrieve data by key

The user can retrieve the desired data by the key defined in the input data schema. The `FindRows` method of the `InputTable` object allows you to retrieve all data with a specific Key. The first parameter of the `FindRows` method refers to the Key in the KeyMappings.

See the code example below for more details.

* Example 1: Retrieve data with value \[3] for \["COL\_1"] through KeyMappings 1 with \["COL\_1"] as Key defined in SampleData schema.
* Example 2: Retrieve data where \["COL\_1", "COL\_2"] has value \[1, 3] through KeyMappings 2 with \["COL\_1", "COL\_2"] as Key defined in SampleData schema.

```csharp
InputTable sampleData = InputManager.Instance.GetInput("SampleData");

// Example 1
List<IInputRow> finds = sampleData.FindRows(1, 3);
// Example 2
List<IInputRow> finds2 = sampleData.FindRows(2, 1, 3);
```
