# Paths

When working with paths, we need to determine whether the path provided is a folder or absolute filename.

If the path provided ends with a "/", then we will assume that the path is a directory and include it and the original filename,&#x20;

For example:

| Source File             | Configured Path | Result                   |
| ----------------------- | --------------- | ------------------------ |
| /directory/filename.txt | /newdir/        | /newdir/filename.txt     |
| /directory/filename.txt | filename2.txt   | /directory/filename2.txt |

You can use dynamic variables in the path to compose a useful destination filename. Available variables are:

| Variable         | Example Result            | Desc                          |
| ---------------- | ------------------------- | ----------------------------- |
| {EXISTING\_NAME} | filename.txt              | Take the filename             |
| {TIMESTAMP}      | 160331234                 | A unix timestamp              |
| {YYYY}           | 2050                      | The current year              |
| {YY}             | 50                        | The current year in shorthand |
| {MM}             | 03                        | The month                     |
| {DD}             | 10                        | The day of the month          |
| {USER}           | donald                    | The user on the event         |
| {EVENT.\*}       | {EVENT.username} - donald | Any attribute on the event    |

&#x20;

An example of a dynamic path used in a copy operation:

```
{
    "type":"copy",
    "copy_to":"/processed_files/{USER}/{YY}/{MM}/{DD}/{EXISTING_FILENAME}"
}
```


---

# Agent Instructions: 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:

```
GET https://developers.couchdrop.io/administration/automations/actions/paths.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
