# Criteria for adding and updating calendar information

The `criteria` object specifies the calendar to create or the calendar entry to add or update:

- To create a new calendar, specify the properties listed in Table: Creating a new calendar.

- To add a new calendar entry, specify the properties listed in Table: Adding a new calendar entry.

- To update an existing calendar entry, first use `GetList` to retrieve the `LocalId` of that entry, and then specify the properties listed in Table: Updating a calendar entry. Use the `LocalId` returned by `GetList` as the value for `Item.LocalId`.

The `criteria` object has two main properties: `Type` and `Item`.

Table: Criteria object properties (creating a new calendar)
Property | Description | Type | Value
--- | --- | --- | ---
`criteria.Type` | Specifies the type of calendar information to add or update. For creating a new calendar, this is always `"Calendar"`. | string | Possible values: `"Calendar"`
`criteria.Item` | Specifies the calendar to create. | object | Object with the properties specified below
`criteria.Item.CalendarName` | Specifies the drive letter and file name of the new calendar file. | string | `<DriveLetter>:<FileName>` For example: `"C:Calendar"`

Table: Criteria object properties (adding a new calendar entry)
Property | Description | Type | Value
--- | --- | --- | ---
`criteria.Type` | Specifies the type of calendar information to add or update. For adding a new calendar entry, this is always `"CalendarEntry"`. | string | Possible values: `"CalendarEntry"`
`criteria.Item` | Specifies the calendar entry to add. The exact set of properties that need to be specified depends on the type of the entry. For more information about which properties are valid for a given type, see section Properties and calendar entry types. | object | Object with the properties specified below
`[criteria.Item.CalendarName]` | Specifies the calendar file to which the entry is added. If this property is not specified, the entry is added to the default calendar. If the default calendar does not exist, it is created. | string | `<DriveLetter>:<FileName>` For example: `"C:Calendar"`
`criteria.Item.<property>` | For detailed information about the properties and their values, see section Calendar entry properties. | (depends on the property) | For example, to add a new meeting: `criteria``.Item.Type = "Meeting";`

Table: Criteria object properties (updating a calendar entry)
Property | Description | Type | Value
--- | --- | --- | ---
`criteria.Type` | Specifies the type of calendar information to add or update. For updating an existing calendar entry, this is always `"CalendarEntry"`. | string | Possible values: `"CalendarEntry"`
`criteria.Item` | Specifies the new information and the calendar entry to update. The exact set of properties that need to be specified depends on the type of the entry. For more information about which properties are valid for a given type, see section Properties and calendar entry types. | object | Object with the properties specified below
`[criteria.Item.CalendarName]` | Specifies the calendar file on which the update is performed. If this property is not specified, the update is performed on the default calendar. | string | `<DriveLetter>:<FileName>` For example: `"C:Calendar"`
`criteria.Item.LocalId` | Identifies the calendar entry to update. This can be either a parent or child entry. | string |
`[criteria.Item.InstanceStartTime]` | In case of a recurring entry, specify `InstanceStartTime` to identify the instance to modify. The specified instance is stored as a new child entry. If this property is not specified, the whole entry is updated. | date object |
`criteria.Item.<property>` | For detailed information about the properties and their values, see section Calendar entry properties. Properties that are not specified remain unchanged. | (depends on the property) |