> ## 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 retrieve an Entity

> How to retrieve an Entity

We need to retrieve an Entity for several purposes, viewing the properties of an Entity is one such purpose.

## Syntax

The following example shows the use of the `GetFromIdx` function to retrieve an Entity.

```csharp theme={null}
using SuperOffice.CRM.Entities;
using SuperOffice;
using(SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
  //Retrieving a Property of PersonEntity
  Person newPerson = Person.GetFromIdxPersonId(20);
  string personName = newPerson.Firstname;
}
```

## Retrieve an Entity with basic properties

Retrieving basic properties of a `Contact` Entity implies obtaining properties that are neither Entities nor Rows.

The following example demonstrates how to retrieve properties of **basic data type** of an Entity.

```csharp theme={null}
using SuperOffice.CRM.Entities;
using SuperOffice.CRM.Rows;
using SuperOffice;
using(SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
  //Retrieving an Entity
  Contact newContact = Contact.GetFromIdxContactId(11);

  //Retrieving Basic properties of an Entity
  string aInterests = newContact.ActiveInterests.ToString();
  string depart = newContact.Department;
  string kName = newContact.Kananame;
  string cName = newContact.Name;
  string cNum1 = newContact.Number1;
  string cNum2 = newContact.Number2;
  string orgNum = newContact.OrgNr;
  string cRegDate = newContact.Registered.ToString();
}
```

Here, the `Registered` property is of Datetime data type. All the other properties (Department, Kananame, Name, Number1, Number2, OrgNr) are of type String.

## See also

* [Retrieve an Entity property through an Entity][1]
* [Retrieve a row through an Entity][2]

[1]: ./get-entity-from-entity

[2]: ../rows/get-row-from-entity


## Related topics

- [How to retrieve members of a specific selection using entities](/en/api/search/selection/entity/get-selection-members-entity.md)
- [How to retrieve members of a specific selection using archive provider](/en/api/search/selection/archive/get-selection-members-provider.md)
- [How to retrieve members of a specific selection using services](/en/api/search/selection/services/get-selection-members-services.md)
- [Selection](/en/api/search/selection/index.md)
- [Retrieve a sale](/en/automation/crmscript/howto/sale/get.md)
- [How to list all selected interests for a contact (services)](/en/api/web-services/howto/company/get-interests-for-contact-services.md)
- [How to use ActivityArchive filters](/en/api/search/iarchiveagent/using-activityarchive-filters.md)
