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

# SuperOffice.WebApi.Agents.IMDOAgent

<h1 id="SuperOffice_WebApi_Agents_IMDOAgent">
  Interface IMDOAgent
</h1>

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

MDO Lists, reading, searching, and item lookup.

```csharp theme={null}
public interface IMDOAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetListAsync_System_String_System_Boolean_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_">
  GetListAsync(string, bool, string, bool, RequestOptions)
</h3>

Method to get a MDO list.

```csharp theme={null}
Task<MDOListItem[]> GetListAsync(string name, bool forceFlatList, string additionalInfo, bool onlyHistory, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list-

`forceFlatList` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Force the list to be flat

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`onlyHistory` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, return only history items

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Array of MDOListItem

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetListIdByListNameAsync_System_String_SuperOffice_WebApi_RequestOptions_">
  GetListIdByListNameAsync(string, RequestOptions)
</h3>

Retrieve the UdListDefinition id of a list, by its name. Not all lists have such an ID, but those that are based on tables do (the list name is then the same as the table name)

```csharp theme={null}
Task<int> GetListIdByListNameAsync(string name, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The list name, same as the table name for lists that are backed by tables

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

List id in the UdListDefinition table

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetListItemAsync_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_">
  GetListItemAsync(string, int, RequestOptions)
</h3>

Returns a single list item

```csharp theme={null}
Task<MDOListItem> GetListItemAsync(string listName, int id, RequestOptions requestOptions = null)
```

#### Parameters

`listName` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list

`id` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of list item

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\&gt;

Single MDO list item

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetListNamesAsync_SuperOffice_WebApi_RequestOptions_">
  GetListNamesAsync(RequestOptions)
</h3>

Returns a list of all MDO List names. These names can also be used with the Archive agent as ProviderNames.

```csharp theme={null}
Task<string[]> GetListNamesAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

Array of list names.

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetListWithHistoryAsync_System_String_System_Boolean_System_String_System_Int32___System_Boolean_SuperOffice_WebApi_RequestOptions_">
  GetListWithHistoryAsync(string, bool, string, int\[], bool, RequestOptions)
</h3>

Method to get a MDO list with own history list.

```csharp theme={null}
Task<MDOListItem[]> GetListWithHistoryAsync(string name, bool forceFlatList, string additionalInfo, int[] historyItems, bool onlyHistory, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list-

`forceFlatList` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Force the list to be flat

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`historyItems` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

An array of ids, used to get the history list

`onlyHistory` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, return only history items

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Array of MDOListItem

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetListWithRestrictionAsync_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_">
  GetListWithRestrictionAsync(string, string, string, RequestOptions)
</h3>

Method to get a MDO list with restrictions.

```csharp theme={null}
Task<MDOListItem[]> GetListWithRestrictionAsync(string name, string additionalInfo, string searchValue, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list-

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`searchValue` [string](https://learn.microsoft.com/dotnet/api/system.string)

the value used to restrict the list

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Array of MDOListItem

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetSelectableListAsync_System_String_System_Boolean_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_">
  GetSelectableListAsync(string, bool, string, bool, RequestOptions)
</h3>

Method to get a Selectable MDO list.

```csharp theme={null}
Task<SelectableMDOListItem[]> GetSelectableListAsync(string name, bool forceFlatList, string additionalInfo, bool onlyHistory, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list.

`forceFlatList` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Force the list to be flat

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`onlyHistory` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, return only history items

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of SelectableMDOListItem

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetSelectableListWithHistoryAsync_System_String_System_Boolean_System_String_System_Int32___System_Boolean_SuperOffice_WebApi_RequestOptions_">
  GetSelectableListWithHistoryAsync(string, bool, string, int\[], bool, RequestOptions)
</h3>

Method to get a Selectable MDO list with own history list.

```csharp theme={null}
Task<SelectableMDOListItem[]> GetSelectableListWithHistoryAsync(string name, bool forceFlatList, string additionalInfo, int[] historyItems, bool onlyHistory, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list.

`forceFlatList` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Force the list to be flat

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`historyItems` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

An array of ids, used to get the history list

`onlyHistory` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, return only history items

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of SelectableMDOListItem

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetSelectableListWithRestrictionAsync_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_">
  GetSelectableListWithRestrictionAsync(string, string, string, RequestOptions)
</h3>

Method to get a Selectable MDO list with restrictions.

```csharp theme={null}
Task<SelectableMDOListItem[]> GetSelectableListWithRestrictionAsync(string name, string additionalInfo, string searchValue, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`searchValue` [string](https://learn.microsoft.com/dotnet/api/system.string)

the value used to restrict the list

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of SelectableMDOListItem

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetSelectableSimpleListAsync_System_String_SuperOffice_WebApi_RequestOptions_">
  GetSelectableSimpleListAsync(string, RequestOptions)
</h3>

Method returns a flat Selectable MDO List.

```csharp theme={null}
Task<SelectableMDOListItem[]> GetSelectableSimpleListAsync(string name, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of SelectableMDOListItem

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_GetSimpleListAsync_System_String_SuperOffice_WebApi_RequestOptions_">
  GetSimpleListAsync(string, RequestOptions)
</h3>

Method returns a simple flat MDO List.

```csharp theme={null}
Task<MDOListItem[]> GetSimpleListAsync(string name, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Array of MDOListItem

<h3 id="SuperOffice_WebApi_Agents_IMDOAgent_SetSelectedAsync_System_String_System_String_SuperOffice_WebApi_Data_SelectableMDOListItem___SuperOffice_WebApi_RequestOptions_">
  SetSelectedAsync(string, string, SelectableMDOListItem\[], RequestOptions)
</h3>

Saves the selected values as selected by their given list representation.

```csharp theme={null}
Task<SelectableMDOListItem[]> SetSelectedAsync(string name, string additionalInfo, SelectableMDOListItem[] selectableMDOList, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`selectableMDOList` [SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]

Items to be updated

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of updated SelectableMDOListItems


## Related topics

- [SuperOffice.WebApi.Agents.MDOAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.MDOAgent.md)
- [SuperOffice.WebApi.Agents.IListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IListAgent.md)
- [SuperOffice.WebApi.Agents.ListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ListAgent.md)
- [SuperOffice.WebApi.Agents.IEMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IEMailAgent.md)
- [SuperOffice.WebApi.Agents.EMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.EMailAgent.md)
- [SuperOffice.WebApi.Agents.AIAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.AIAgent.md)
