> For the complete documentation index, see [llms.txt](https://docs.kognitos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kognitos.com/legacy/legacy-experience/automation-areas/department-box/clean-items-before-a-certain-date.md).

# Clean Items Before a Certain Date

### Overview

This procedure removes all **the keys** from a department box *(a storage unit within an agent)* before a certain date. The date can be specified as a relative or absolute value.

### Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

<details>

<summary><code>x is a department box</code></summary>

#### What does it do?

Specifies a department box.

#### Where does it go?

This phrase should be written on a **new line**.

#### Is it required?

✅ Yes — This phrase is **required**.

#### Does it require data?

✅ Yes — Replace **x** with the department box's name.

#### Example

```
HR is a department box
```

</details>

<details>

<summary><code>the department box's engine is x</code></summary>

#### What does it do?

Specifies the engine used for the department box. Options include: **Amazon S3** for large or unstructured data, **Amazon DynamoDB** for fast key-value lookups, and **Amazon OpenSearch** for advanced search and filtering capabilities.

#### Where does it go?

This phrase should be written on a **new line**.

#### Is it required?

❌ No — This phrase is **optional**.

#### Does it require data?

✅ Yes — Replace **x** with one of the following values: `s3`, `dynamodb`, `opensearch`. The default is `s3`.

#### Example

```
the department box's engine is "dynamodb"
```

</details>

<details>

<summary><code>clean x before "date"</code></summary>

#### What does it do?

Removes all keys from the department box before a certain date.

#### Where does it go?

This phrase should be written on a **new line**.

#### Is it required?

✅ Yes — This phrase is **required**.

#### Does it require data?

✅ Yes — Replace **x** with the department box's name. Replace **date** with a text value or reference to a date or time, which can be relative or absolute.

#### Example

```
clean HR before '3 hours'
```

</details>

### Examples

#### 1. Clean Before Relative Date

A relative date is based on the current time. The following removes all items from the department box that are older than 3 hours:

```
HR is a department box
the department box's engine is "s3"
clean HR before '3 hours'
```

#### 2. Clean Before Absolute Date

An absolute date is a fixed point in time. The following removes all items from the department box that were added before October 23, 2020:

```
HR is a department box
the department box's engine is "s3"
clean HR before '23rd Oct 2020'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kognitos.com/legacy/legacy-experience/automation-areas/department-box/clean-items-before-a-certain-date.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
