# Year Addition

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to add a specified number of years to the given date based on the format specified in the input value column. The execution status is then stored in a dynamic variable.

## Syntax

**Input Value**: `<date>;<number of Years>;<current date format>`

| Argument                                    | Description                                                                                                                                                       |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<date><br>(Required)</p>                | Provide the starting date.                                                                                                                                        |
| <p>\<number of Years><br>(Required)</p>     | Provide the number of years to add to the starting date.                                                                                                          |
| <p>\<current date format><br>(Required)</p> | <p>Provide the format of the starting date.<br>Supported date formats:</p><ul><li>dd/MM/yyyy</li><li>MM/dd/yyyy</li><li>MMM/dd/yyyy</li><li>dd/MMM/yyyy</li></ul> |

**Output Value**: `<Dynamic Variable>;<Dynamic Variable>(Optional)`

| Argument                                 | Description                                                                               |
| ---------------------------------------- | ----------------------------------------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p> | This dynamic variable stores the updated date after adding the specified number of years. |
| <p>\<Dynamic Variable><br>(Optional)</p> | This dynamic variable stores the status as **True** or **False**.                         |

### Example: Adding Years to a Date

In this example, we explain how to add a specific number of years to a given date.

* **Action**: Year Addition
* **Input Value**: 15/03/2025;2;dd/MM/yyyy
  * The first argument (**15/03/2025**) specifies the original date.
  * The second argument (**2**) specifies the number of years to add.
  * The third argument (**dd/MM/yyyy**) specifies the current format of the input date.
* **Output Value**: {Updated Date}
  * The resulting date (15/03/2027) after adding the specified number of years is stored in this **{Updated Date}** dynamic variable.
  * If a second output variable is provided, the action returns the status as True/False:
    * **True**: If the year addition is successful.
    * **False**: If the operation fails due to an invalid date or format.
* **Logical Explanation**: The **Year Addition** action fetches the value from the **Input Value** column (**15/03/2025;2;dd/MM/yyyy**), adds the specified number of years (2) to the input date, and stores the resulting date (15/03/2027) in the **{Updated Date}** variable.&#x20;

<figure><img src="/files/WINfkQ9TWjTGMwj6UvZ2" alt=""><figcaption></figcaption></figure>

#### **Knowledge Bites:**&#x20;

Here are some examples of the different date formats:

<table><thead><tr><th>Date formats </th><th width="258.4622802734375">Input Value</th><th>Result </th></tr></thead><tbody><tr><td>dd/MM/yyyy</td><td><strong>15/04/2025;5;dd/MM/yyyy</strong></td><td>15/04/2030</td></tr><tr><td>MM/dd/yyyy</td><td><strong>04/15/2025;2;MM/dd/yyyy</strong> </td><td>04/15/2027</td></tr><tr><td>dd/MMM/yyyy</td><td><strong>15/Apr/2025;1;dd/MMM/yyyy</strong></td><td>15/Apr/2026</td></tr><tr><td>MMM/dd/yyyy</td><td><strong>Apr/15/2025;6;MMM/dd/yyyy</strong></td><td>Apr/15/2031</td></tr></tbody></table>


---

# 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://docs.avoautomation.com/avo-assure/actions/generic/date-operations/year-addition.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.
