> ## 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.

# How to list all selected interests for a contact (services)

> How to list all selected interests for a contact using services

You can use  `SuperOffice.Services` and `SuperOffice.Services.Impl` DLLs to list all selected [interests][1] for a specific contact.

## Code

```csharp theme={null}
using SuperOffice;
using SuperOffice.CRM.Services;

Console.Write("Please Enter the UserName :- ");
string userName = Console.ReadLine();

Console.Write("Please enter the password :- ");
string passWord = Console.ReadLine();
Console.WriteLine();

using (SoSession newSession = SoSession.Authenticate(userName, passWord))
{
  //Retrieve a Contact Entity using the Contact Agent
  ContactAgent newConAgt = new ContactAgent();
  ContactEntity newConEnt = newConAgt.GetContactEntity(10);

  //Retrieve all available Interests for a Contact
  SelectableMDOListItem[] newSelMdoLstItms = newConEnt.Interests;

  foreach(SelectableMDOListItem newSelMdoLstItm in newSelMdoLstItms)
    {
      //Retrieve only the selected Interest of the Contact
      if(newSelMdoLstItm.Selected)
        Console.WriteLine(newSelMdoLstItm.Name);
    }

  Console.ReadLine();
}
```

## Walk-through

Using the `ContactAgent`, we first retrieve a `Contact` entity. Next is to retrieve the available interests of the contact. We use the `Interests` property of the entity and retrieve the interest list into a `SelectableMDOListItem` array.

By iterating on the array, we can retrieve details of each interest available. Since we want only the *selected* interest, we add an if-condition to filter out any item that is not selected.

Comparing the **Interest** tab of the **Company** card in the SuperOffice and our obtained output we can confirm our results.

[1]: ../../../../company/dev/index#interests


## Related topics

- [How to set an interest on or off for a contact (services)](/en/api/web-services/howto/company/set-interest-on-off-services.md)
- [How to set a user-defined list item on a Udef field (services)](/en/api/web-services/howto/custom-objects/set-udef-listitem-value.md)
- [List interests for a person](/en/automation/crmscript/howto/contact/get-interests.md)
- [Interests](/en/automation/crmscript/howto/interests/index.md)
- [Set/clear interest on contact](/en/automation/crmscript/howto/interests/contact-interests.md)
- [How to display an image from the Blob table (services)](/en/api/web-services/howto/contact/display-image-from-blob-table-services.md)
