---
title: "Using Luminesce to write different kinds of property for LUSID entities"
slug: "using-luminesce-to-write-different-kinds-of-property-for-lusid-entities"
updated: 2024-08-22T06:10:08Z
published: 2024-08-22T06:10:08Z
canonical: "support.lusid.com/using-luminesce-to-write-different-kinds-of-property-for-lusid-entities"
---

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

# Using Luminesce to write different kinds of property for LUSID entities

You can use Luminesce to write (that is, add, update or delete) properties for LUSID entities in two ways:

- For some entities such as instruments, portfolios and transactions, you can use [dedicated property providers](/v1/docs/using-luminesce-to-readwrite-lusid-investment-data#properties).
- For any entity, by first [configuring its entity provider](/v1/docs/how-do-i-configure-luminesce-entity-providers-to-readwrite-properties) to 'inline' properties into the Luminesce catalog. You can then use that entity provider to interact with properties in the same way as standard entity data fields.

[Properties in LUSID are multi-faceted](/v1/docs/properties). This article demonstrates nuances of writing different kinds of property to an example instrument mastered in LUSID:

- Using a query like this for the dedicated [Lusid.Property.Writer](/v1/docs/lusidpropertywriter) property provider:

```sql
@table_of_data = select 'Figi' as EntityIdType, 'BBG000C05BD1' as EntityId, 'Instrument' as Domain, 'Test' as PropertyScope, 
'MyStringProperty' as PropertyCode, 'Fred Bloggs' as Value, 'Upsert' as WriteAction;
select * from Lusid.Property.Writer where ToWrite = @table_of_data;
```

- Using a query like this for a configured [Lusid.Instrument.Equity.Writer](/v1/docs/lusidinstrumenttypewriter-providers) entity provider:

```sql
@table_of_data = select 'BBG000C05BD1' as Figi, 'BP' as DisplayName, 'GBP' as DomCcy, 
'Fred Bloggs' as MyStringProperty, 'Upsert' as WriteAction;
select * from Lusid.Instrument.Equity.Writer where toWrite = @table_of_data;
```

## Writing number, datetime and boolean properties

### Using a dedicated property provider

The mandatory `Value` field is a text field so you must supply property values as strings. Luminesce attempts to cast string values to the native type, or raises an error. For example:

```sql
@table_of_data = select 'MyNumericProperty' as PropertyCode, '200' as Value
@table_of_data = select 'MyDateTimeProperty' as PropertyCode, '2023-11-15 15:59:59' as Value
@table_of_data = select 'MyBooleanProperty' as PropertyCode, 'False' as Value
```

### Using a configured entity provider

You specify the data type of the property when you inline it, so you can supply values in the native format. Note that dates in Luminesce must be encapsulated in `#` characters. For example:

```sql
@table_of_data = select 200 as MyNumericProperty
@table_of_data = select #2023-11-15 15:59:59# as MyDateTimeProperty
@table_of_data = select False as MyBooleanProperty
```

## Writing time-variant properties

### Using a dedicated property provider

You should use the `EffectiveFrom` and `EffectiveUntil` fields to specify the validity period of a property value, for example:

```sql
@table_of_data = select 'MyTimeVariantProperty' as PropertyCode, 'Joe Bloggs' as Value, #2023-01-01# as EffectiveFrom, #2023-06-30# as EffectiveUntil
```

If you omit:

- `EffectiveFrom`, a property value is valid from the datetime the query runs.
- `EffectiveUntil`, a property value is valid until 9999-12-31.

> **Note**: You can retrieve the values of a time-variant property as a time-series using the [Lusid.Property](/v1/docs/lusidproperty) provider with the `GetHistorical` parameter.

### Using a configured entity provider

You should use the `EffectiveFrom` and `PropertiesEffectiveUntil` *parameters* to specify the validity period of a property value, for example:

```sql
@table_of_data = select 'Joe Bloggs' as MyTimeVariantProperty;
select * from Lusid.Instrument.Equity.Writer where toWrite = @table_of_data and EffectiveFrom = #2023-06-30# and PropertiesEffectiveUntil = #2023-06-30#;
```

If you omit:

- `EffectiveFrom`, a property value is valid from the datetime the query runs.
- `PropertiesEffectiveUntil`, a property value is valid until 9999-12-31.

## Writing multi-value properties

Currently, multi-value properties in LUSID can only be strings. [More limitations](/v1/docs/how-do-i-add-a-multi-value-property-to-an-entity).

The value set must be a comma-separated list. The following examples use a dedicated property provider, but the principles apply when using a configured entity provider too:

```sql
@table_of_data = select 'MyMultiValueProperty' as PropertyCode, 'Value One, Value Two, Value Three' as Value
```

If a value has a comma or trailing white space, encapsulate that value in `"` characters, for example:

```sql
@table_of_data = select 'MyMultiValueProperty' as PropertyCode, 'Value One, "Value Two, with a comma", " Value Three with trailing white space "' as Value
```
