Hello,
I have a compose action that gets the current year: formatDateTime(utcNow(), 'yyyy')
This works great. What I'm trying to do is use another compose action that adds one year to the year above. So far I have been trying the addtoTime and addDays expressions but have been unsuccessful.
The last one I tried was: addDays(outputs('Compose_5'), 365, 'yyyy')
Ultimately, I would like to use these steps to build a condition that says if a folder with the current year does not exist in my SharePoint library, then create a new folder for the new year. So I've created a folder for 2024 but when 2025 arrives and subsequent new years, I would like for the workflow to create the new folder for documents to be populated into. Can anyone help me with any guidance on this?
@creativeopinion, this worked perfectly. Thank you! Also, thanks for the helpful YT tutorial link. I'll check that out.
You can use a single expression:
formatDateTime(addDays(utcNow(),365),'yyyy')
You might be interested in this YT Tutorial: How to Work with 📆 Dates in Power Automate | Example Scenarios and Tips & Tricks
Are you easily stumped when working with Dates in Power Automate? In this Power Automate tutorial, I’ll show you how to compose an expression that will return a future date, a past date, how to count the number of days between two dates, how to check for a birthdate and anniversary date as well as tips and tricks when working with dates in Power Automate.
I’ll cover some common use cases and concepts that can help you to build better Power Automate flows. Feel free to skip ahead using the timestamps listed below. I’ve also linked a few other tutorials that you might be interested in as well.
IN THIS VIDEO:
âś… 4 Date Functions You Need to Know
âś… How to use the Convert Time Zone Action
âś… How to Get a Future Date
âś… How to Get a Past Date
âś… How to Return SharePoint Items Due in a Number of Days
âś… How to Return SharePoint Items Due within a Date Range
âś… How to write a Filter Query for SharePoint Items Due in 30, 60 and 90 Days
âś… How to Calculate the Number of Days between Two Dates
âś… How to Check for a Birthdate and Anniversary Date
âś… How to work with Dates and Times in Excel
âś… How to use a Manual Trigger with Date Input
âś… How to Output Dynamic Text with an Expression
âś… How to Check if a Date Falls on a Weekend
Michael E. Gernaey
18
Super User 2025 Season 1
stampcoin
16
Churchy
12