# Month 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 months 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 months>;<current date format>`&#x20;

| Argument                                    | Description                                                                                                                                                         |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<date><br>(Required)</p>                | Provide the starting date                                                                                                                                           |
| <p>\<number of months><br>(Required)</p>    | Provide the number of months 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 months. |
| <p>\<Dynamic Variable><br>(Optional)</p> | This dynamic variable stores the status as **True** or **False**.                          |

## Example: Adding Months to a Date

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

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

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FoCdP1DGY4DMwdlzbyS48%2Fimage.png?alt=media&#x26;token=2ee61be7-30a7-4470-b70c-804d45d86a1b" alt=""><figcaption></figcaption></figure>

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

Here are some examples of adding months to a given date in different 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>15/04/2025;5;dd/MM/yyyy</td><td>15/09/2025</td></tr><tr><td>MM/dd/yyyy</td><td>04/15/2025;2;MM/dd/yyyy </td><td>06/15/2025</td></tr><tr><td>dd/MMM/yyyy</td><td>15/Apr/2025;1;dd/MMM/yyyy</td><td>15/May/2025</td></tr><tr><td>MMM/dd/yyyy</td><td>Apr/15/2025;6;MMM/dd/yyyy</td><td>Oct/15/2025</td></tr></tbody></table>
