Recently, I worked on a project for which a client asked me to use Power Automate to extract the current year, the previous year, and the following year. I used the Power Automate formatDateTime function and UtcNow function to achieve this.
In this tutorial, I will show you how to get current year in Power Automate. Additionally, we will discuss how to get the previous year and the following year using flow with different examples.
Get Current Year in Power Automate
To extract the current year, I will use the Power Automate instant cloud flow that will trigger manually. Follow the steps below:
1. Navigate to Power Automate and click + Create -> select Instant cloud flow. In the next window, provide a flow name, select “Manually trigger a flow,” and click on Create.
2. Then, add an “Initialized variable” to store the data and use it for any calculations or data management during the flow. Here, provide details below:
- Name: Set a name for an initialized variable.
- Type: Select datatype as ‘String‘ from the drop-down.
- Value: Add the below code in value.
formatDateTime(utcNow(),'yyyy')
3. Then, add a Compose data operation to check the output from an initialized variable.
@{variables('Current year')}
4. Now, the flow is ready. Click on the Save button. Click on Test -> Manually to test flow.

5. Then, the outputs of the compose flow action will display the current year.

This is how to get the current year using the Power Automate flow.
Get Previous Year in Power Automate
Similarly, based on the current date (14-10-2023) in Power Automate, I will show you how to get the previous year inside a flow.
In Power Automate, getting the previous year involves using the utcNow() function to get date and time values in UTC and formatting the date value into a year as an integer.
Follow the below step-by-step instructions to create an instant cloud flow:
1. Select Power Automate under the App launcher. Click on +Create -> Select “Instant cloud flow”. In the next window, provide a flow name, choose “Manually trigger a flow” and click on Create.
2. Then, add an “Initialize variable” flow action for formatting date and time and provide details below:
- Name: Set a name for a variable.
- Type: Select datatype as ‘String’ from drop-down.
- Value: Provide the below expression in value.
formatDateTime(utcNow(),'yyyy')
3. Next, add a “Compose” data operation and select inputs as below.
- Inputs: Select output from variables under dynamic content.
sub(int(variables('Previous year')),1)
4. The Output generated from the compose flow action shows the previous year.

This is how to get the previous year by the formatDateTime function in Power Automate flow.
Get Next Year in Power Automate
I will explain how to get the next or following year in a Power Automate flow based on the utcNow() function.
For getting next year by using a Power Automate flow, similarly follow the same.
Here, I will follow the exact step-by-step process to create a Power Automate flow and use this time formatDatetime() function in an initialized variable to get the current date with the year.
Then, I will use the add and int functions to convert the string year to a year integer value.
Follow the below instructions in an “Instant cloud flow”:
1. In the “Initialized variable,” provide the below expression in value with details below.
- Name: Provide a name for a variable.
- Type: Select datatype from the drop-down.
Value: formatDateTime(utcNow(),'yyyy')
2. Then, add a “Compose” data operation and set the details below.
- Inputs: Select from the dynamic content of the initialized variable.
add(int(variables('Next year')),1)
3. The outputs of a compose flow action will show next year inside a flow.

This is how to extract next year from the formatDateTime() function in a Power Automate flow.
Conclusion
I hope you understand how to get the current, previous, and next year in Power Automate with various examples.
You may also like:
- Delete All Items in the SharePoint List Using Power Automate
- Send Birthday Emails from Excel Using Power Automate
- Get Current and Previous Month in Power Automate
- Export SharePoint List to Excel and Send an Email Using Power Automate

Preeti Sahu is an expert in Power Apps and has over six years of experience working with SharePoint Online and the Power Platform. She is the co-author of Microsoft Power Platform: A Deep Dive book. As a Power Platform developer, she has worked on developing various tools using Power Apps and Power Automate. She also makes Microsoft 365 videos and shares them on YouTube.