---
title: "Lusid.Property"
slug: "lusidproperty"
updated: 2024-11-13T08:38:51Z
published: 2024-11-13T08:38:51Z
canonical: "support.lusid.com/lusidproperty"
---

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

# Lusid.Property

| **Type** | **Read/write** | **Author** | **Availability** |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Read | Finbourne | Provided with LUSID |

Providing you have sufficient [access control permissions](/v1/docs/creating-policies-to-control-access-to-providers-for-different-luminesce-end-users), the `Lusid.Property` provider enables you to write a [Luminesce SQL query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that retrieves [custom properties](/v1/docs/properties) for particular types of entity.

Note the syntax and behavior of this provider differs depending on the entity type.

**See also:** [Lusid.Property.Writer](/v1/docs/lusidpropertywriter)

## Portfolios and portfolio groups

In your query you must specify either:

- The `EntityScope` and `EntityId` fields to identify the scope and code of a portfolio or portfolio group whose properties to return.
- The `PropertyScope` and `PropertyCode` fields to identify the scope and code of a property whose parent portfolios or portfolio groups to return.

For example, to retrieve all the properties for a particular portfolio:

```sql
select * from Lusid.Property where Domain = 'Portfolio' 
and EntityScope = 'Finbourne-Examples' and EntityId = 'UK-Equities';
```

To retrieve all the portfolio groups that have a particular property:

```sql
select * from Lusid.Property where Domain = 'PortfolioGroup'
and PropertyScope = 'FundManagers' and PropertyCode = 'Name';
```

To retrieve all properties for all portfolios:

```sql
select prop.*
from Lusid.Portfolio port
inner join Lusid.Property prop
  on prop.Domain = 'Portfolio'
  and prop.EntityScope = port.PortfolioScope
  and prop.EntityId = port.PortfolioCode;
```

## Instruments

In your query you must specify either:

- The `EntityIdType` and `EntityId` fields to identify an instrument whose properties to return. The `EntityIdType` field refers to a [unique instrument identifier](/v1/docs/what-are-unique-and-non-unique-identifiers), and the `EntityId` field to a valid value for that identifier.
- The `PropertyScope` and `PropertyCode` fields to identify the scope and code of a property whose instruments to return.

Specify the `EntityScope` field as well if instruments are mastered in a [custom instrument scope](/v1/docs/understanding-instrument-scopes) (otherwise only the built-in `default` scope is searched).

For example, to retrieve all the properties for a particular instrument identified by [LUID](/v1/docs/what-is-a-lusid-instrument-id-or-luid):

```SQL
select * from Lusid.Property where Domain = 'Instrument' 
and EntityIdType = 'LusidInstrumentId' and EntityId = 'LUID_G67H99J6';
```

To retrieve all the properties for a particular instrument identified by FIGI and mastered in a custom scope:

```SQL
select * from Lusid.Property where Domain = 'Instrument' and EntityScope = 'my-custom-instrument-scope'
and EntityIdType = 'Figi' and EntityId = 'BBG000BDZGH6';
```

To retrieve all the instruments in the `default` scope that have a particular property:

```SQL
select * from Lusid.Property where Domain = 'Instrument'
and PropertyScope = 'Ibor' and PropertyCode = 'GICSSector';
```

To retrieve a history of values for a particular [time-variant property](/v1/docs/understanding-perpetual-and-time-variant-properties) property for a particular entity, specify the `GetHistorical` query parameter:

```SQL
select * from Lusid.Property where Domain = 'Instrument'
and EntityIdType = 'LusidInstrumentId' and EntityId = 'LUID_G67H99J6'
and PropertyScope = 'Ibor' and PropertyCode = 'AnalystRating' and GetHistorical = True;
```

To retrieve all the properties for all the equity instruments in the `default` scope:

```SQL
select * from Lusid.Property where Domain = 'Instrument'
and EntityIdType = 'LusidInstrumentId' and EntityId in
(select LusidInstrumentId from Lusid.Instrument.Equity);
```

## Persons and legal entities

In your query you must specify the `EntityScope`, `EntityIdType` and `EntityId` fields to identify a person or legal entity whose properties to return. These fields refer to the three components of a [user-specified identifier](/v1/docs/representing-people-in-lusid-using-person-entities#understanding-identifiers) for these entity types: `idTypeScope`, `idTypeCode` and `code` respectively.

> **Note**: You cannot reverse this operation and specify the `PropertyScope` and `PropertyCode` fields to look up all the people or legal entities that have a particular property.

For example, to retrieve all the properties for a person whose identifier has an `idTypeScope` of `PortfolioManagers`, an `idTypeCode` of `ManagerId` and a `code` of `PortMan1`:

```SQL
select * from Lusid.Property where Domain = 'Person'
and EntityScope = 'PortfolioManagers' and EntityIdType = 'ManagerId' and EntityId = 'PortMan1';
```

> **Note**: Since an identifier is defined under-the-hood as a [property type with a 3-stage key](/v1/docs/how-do-i-create-a-property-type), this query returns the identifier as well.

To retrieve all the properties for a particular legal entity:

```SQL
select * from Lusid.Property where Domain = 'LegalEntity'
and EntityScope = 'InternationalBanks' and EntityIdType = 'BankId' and EntityId = 'Bank1';
```

To retrieve all the properties for all the people identified as portfolio managers:

```SQL
select prop.*
from Lusid.Person per
inner join Lusid.Property prop
  on prop.Domain = 'Person'
  and prop.EntityScope = 'PortfolioManagers'
  and prop.EntityIdType = 'ManagerId'
  and prop.EntityId = per.PortManId;
```

> **Note**: This query relies on prior configuration of the `Lusid.Person` provider to [inline the PortManId identifier as a field](/v1/docs/how-do-i-configure-luminesce-entity-providers-to-readwrite-properties).
