---
title: "Notification.ManualEvent.Writer"
slug: "notificationmanualeventwriter"
updated: 2024-08-21T13:19:06Z
published: 2024-08-21T13:19:06Z
canonical: "support.lusid.com/notificationmanualeventwriter"
---

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

# Notification.ManualEvent.Writer

| **Type** | **Read/write** | **Author** | **Availability** |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Write | 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 `Notification.ManualEvent.Writer` provider enables you to write a [Luminesce SQL query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that triggers one or more [manual events](/v1/docs/using-the-manual-event-to-notify-people-when-non-lusid-activity-occurs) in LUSID's Notification Service.

You must construct a valid table of data to write, one manual event per record. `Notification.ManualEvent.Writer` lists the fields (columns) available to populate with values for each record, and has a set of parameters to help you construct a valid table.

**See also:** [Notification.Subscription](/v1/docs/notificationsubscription)

## Basic usage

```sql
@table_of_data = <select-statement>;
select * from Notification.ManualEvent.Writer where toWrite = @table_of_data;
```

## Query parameters

`Notification.ManualEvent.Writer` has parameters that help you construct a valid table of data to write.

> **Note:** The `ToWrite` parameter is mandatory and describes the data for the manual events you are triggering.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Notification.ManualEvent.Writer' and FieldType = 'Parameter';
```

## Data fields

`Notification.ManualEvent.Writer` lists the fields you can populate in your table of data to write.

The following fields are mandatory to include in the table of data:

- `Message`
- `Subject`

To list all available fields, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Notification.ManualEvent.Writer' and FieldType = 'Column';
```

## Write errors

We recommend examining the results of every write query using the `WriteError` field.

For each record in the table of data, if unsuccessful, `Notification.ManualEvent.Writer` returns a `WriteError` message containing an error code and explanation to help you discover why LUSID considers the operation invalid.

## Examples

> **Note:** For more example Luminesce SQL queries, visit our [Github repo](https://github.com/finbourne/luminesce-examples/tree/master/examples).

### Example 1: Trigger a manual event

```sql
@data_to_write = select 
'A new corporate action has been announced' as Message, 
'New Corporate Action Announced' as Subject,
'
  {
     "AnnouncementDate": "2023-02-13",
     "Company": "Apple",
     "CorporateAction": "Cash dividend"
  }
' as JsonMessage;
select * from Notification.ManualEvent.Writer where ToWrite = @data_to_write;
```

### Example 2: Trigger multiple manual events with the same subject and message

```sql
@@message = select 'A new corporate action has been announced';
@@subject = select 'New Corporate Action Announced';

@announcements = values
('{
    "AnnouncementDate": "2023-02-15",
    "Company": "Microsoft",
    "CorporateAction": "Stock split" 
}'),
('{
    "AnnouncementDate": "2023-02-17",
    "Company": "BP",
    "CorporateAction": "Reverse stock split"
}');

@data_to_write = select @@message as Message, @@subject as Subject, column1 as JsonMessage from @announcements;
select * from Notification.ManualEvent.Writer where ToWrite = @data_to_write;
```
