In this Power Automate tutorial, we will discuss the addDays function using Microsoft Flow. We will see various examples of Power Automate add days to date And also we will discuss the below points:
- Power Automate add days function
- Power Automate add days to date column
- Power Automate add days to date format
- Power Automate add days to date variable
- How to add days to due date in Power Automate
- Add days to current date in Power Automate
- Power Automate add business days to date
- Add 365 days to date in Power Automate
- Add 2 days to date in power automate
- power automate add one day to date
- power automate add days to start date
- power automate add days exclude weekends
- power automate add days negetive
- power automate add days to datetime
- power automate add days to created date
Power Automate add days function
The Power Automate addDays function will add days to an existing timestamp and to deduct days we can use a negative value.
The Power Automate addDays function syntax
addDays('<timestamp>', <days>, '<format>'?)
Power Automate add days to date column
Here we will see how to add days to the SharePoint date column using Power Automate.
I have created a SharePoint list called Event list, so in this list, we have a date column called event date. We will add 2 days to the event date column.
In Power Automate, select the ‘when an item is created‘ trigger. Then provide the site address and list name.
Now we will add days to the date column, so click on the next step and select Compose action. Then in input provide the below expression:
addDays(triggerOutputs()?['body/EventDate'],2,'yyyy-MM-dd')
Now click on save and to run the flow create an item in the SharePoint list with the event date as 2-03-2022. After adding 2 days to the date column it will be 04-03-2022.
This is how to add days to date column using Power Automate.
Read Convert SharePoint document to PDF using Power Automate
Power Automate add days to date format
Here we will see an example of add days to date format using Power Automate.
In Power Automate, select the Manually trigger flow, then click on the next step.
Next, we will initialize a string variable to store the data, so select initialize variable action. Then provide the variable name, types string, and in value add a date with iso format.
Then add 1 day to date and format it to ‘dd-MM-yyyy’, so click on the Next step and select compose action, then provide the below expression:
addDays(variables('varDate'),1,'dd-MM-yyyy')
This is an example of Power Automate add days to date format.
Read Send an Email when Item added in a SharePoint list using Microsoft Flow
Power Automate add days to due date
Here we will see an example of Power Automate add days to the due date.
We have created a SharePoint list called Project, so in this list, we have a date column called the last date column. Once we add days to the date column we will update the list item with the updated last date
In Power Automate, select the ‘When an item is created’ trigger, then provide the site address, and list name.
Next, we will add 10 days to the due date, so click on the Next step and select compose action. Then in input provide the below expression
addDays(triggerOutputs()?['body/Lastdate'],10,'dd-MM-yyyy')
Next, update the item with the new due date, so click on the next step and select Update item action. Then provide the site address, list name, id, title, and in an update due date column provides the output of composing action.
Now click on Save and to run the flow, create an item in the SharePoint list and you can see the result in the SharePoint
This is how to add days to the due date in Power Automate.
Read Microsoft Flow or PowerAutomate Example: Send a customized email when a new file is added
Power Automate add days to current date
Here we will see how to add days to the current date using Power Automate.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Next, we will add 10 days to the current date, so click on the Next step and select Compose action. Then in input write the below expression:
addDays(utcNow(),10,'yyyy-MM-dd')
This is how to add days to current date in Power Automate.
Read Microsoft Flow or PowerAutomate Example: Save my email attachments to a SharePoint document library
Power Automate add 365 days to date
Here we will see how to add 365 days to the given date using Power Automate.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Next, we will initialize a variable to sore the date, so click on the Next step and select Initialize variable action. Then provide the variable name, type as string, and in value add a date.
Next, we will add 365 days to the above date, so click on the Next step and select compose action. Then in Input provide the below expression:
addDays(variables('Date'),365,'yyyy-MM-dd')
Now click on Save and run the Flow, you can see the 365 days are added to the given date.
This is how to add 365 days to date column using Power Automate.
Read Microsoft Flow Example Save tweets that include specific hashtag to a SharePoint list
Add 2 days to date in Power Automate
Here we will see how to add 2 days to date in Power Automate.
In Power Automate, select the Manually triggered Flow, then click on the Add an input and select date.
Next click on Add an action, select initialize variable action. Then provide the variable name, type as string, and in value write the below expression:
addDays(triggerBody()['date'],2,'yyyy-MM-dd')
Now click on Save and to run the flow assign a date like below:
Now you can see the date in output is incremented with 2 days if the date is 15-03-2022 to 17-03-2022.
This is how to add 2 days to date in Power Automate.
Read Move files from OneDrive for Business to SharePoint Online
Power Automate add one day to date
Here we will see how to add one day to date in Power Automate.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Next, initialize variable action, then provide the variable name, type as string, and in value provide the current date with below expression.
utcNow()
Next, we will add compose action, then in Input add the below expression to add one day.
addDays(variables('Date'),1,'dd-MM-yyyy')
Now click on Save and run the Flow manually and you can see the result in the compose output.
This is how to add one day to date in Power Automate.
Read Log Gmail emails to a Google Sheet using Power Automate
Power Automate add days to start date
Here we will see how to add days to the start date using Power Automate.
So, for this example, we will use the task list in SharePoint Online.
In Power Automate, select the trigger When an item is created. Then provide the site address and list name.
Next, click on Add an action, select Initialize variable action. Then provide the variable name, type as a string, and in value add the start date from dynamic content.
Now click on Add an action, then select the compose action, and in Input write the below expression.
addDays(triggerOutputs()?['body/StartDate'],10,'yyyy-MM-dd')
Now click on Save and to run the flow create an item in the SharePoint list. You can see 10 days added to the start date.
This is how to add days to the start date using Power Automate.
Read Send myself a reminder in 10 minutes in Power Automate
Power Automate add days exclude weekends
Here we will see how to add days to exclude weekends in power Automate.
In Power Automate, select manually triggered Flow, then click on the next step.
Next select initialize variable action, then provide the variable name, and type as a string.
Add another initialize variable action, then provide the variable name, type as a string, and in value assign a date.
Now we will check the day is weekend or not by using the days of week function, it returns 0 if the date is Sunday, we will add 1 day to the date and returns 6 if the day is Saturday, we will add 2 days to the date. So, click on the Next step and select Switch action then provide the below expression:
dayOfWeek(variables('StartDate'))
Next, when the case equals 0, click on add an action and select Set variable action. Then select variable and provide the below expression:
addDays(variables('StartDate'),1)
When the case equals 6, click on Add an action and select Set variable action. Then select variable and provide the below expression:
addDays(variables('StartDate'),2)
In the default case, click on add an action, select Set variable action. Then select the variable name, add the start date.
Now click on Save and run the flow manually. As 2022-03-05 is Saturday so case 2 will run and will add 2 days to the date.
This is how to add days excluding weekends using Power Automate.
Read Save Twitter Tweets in SharePoint Online list using Microsoft Flow
Power Automate add days negative
Here we will see how to subtract 10 days from a date using Power Automate addDays function.
In Power Automate, select the Manually triggered Flow. Then click on the next step.
Select Initialize variable, then provide the variable name, type as a string, and in value provide a sample date.
Next, we will deduct 10 days from the above days, so click on the Next step and select compose action. Then in Input provide the below expression:
addDays(variables('varDate'),-10,'dd-MM-yyyy')
This is an example of Power Automate add days negative.
Read How to create auto-increment column in SharePoint List
Power Automate add days to datetime
Here we will see how to add days to date time using Power Automate.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Select compose action then in input field add the below expression:
utcNow()
Now we will add 2 days to the date-time, so click on the next step and select compose action. Then in Input provide the below expression:
addDays(outputs('Compose-_Ge_current_date_and_time'),2)
Now click on Save and run the flow manually and you can see the date-time stamp incremented by 2 days.
This is how to add days to DateTime using Power Automate.
Read Microsoft Flow or PowerAutomate: Trigger email based on user input
Power Automate add days to created date
Here we will see how to add days to the created date of the SharePoint item using Power Automate.
For this example, we will use the below SharePoint list called Event list.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Select Get items action, then provide the site address, List name of the SharePoint list.
Next, we will add days to the created date, so click on the Next step and Add apply to each action, then provide the value from dynamic content.
Now click on Add an action inside apply to each, then select compose action, and in input provide the below expression.
addDays(item()?['Created'],30,'dd-MM-yyyy')
Now click on Save and run the flow and you can see 30 days are added to the created date.
This is how to add days to created date using Power Automate.
Read Create a Leave request approval workflow using Microsoft Flow in SharePoint Online
Power Automate add business days to date
Here we will see how to add business days to date by excluding weekends and holidays using Power Automate or Microsoft Flow.
So for this example, we will use the task list, to calculate the due date of a task by excluding weekends and holidays.
Next, we have a holiday list in SharePoint online.
In Power Automate, select the trigger, When an item is created. Then provide the site address and list name.
Now we will initialize 4 variables for Working days, counter, Start date, and Due date. So click on the Next step and select initialize variable action. Then provide the variable name, type, and value like below:
Now we will use Do until to loop the action until the value of the counter variable is equal to working days.
Inside Do until click on Add an action and select Compose action. In input select start date from dynamic content.
Next, we will increment the start date by 1, so click on the Next step and select Set variable action, then select the variable name, and in value write the below expression
addDays(outputs('Compose'),1,'yyyy-MM-dd')
Next, we will check the weekend, so inside do until action, add a condition action, then provide the below expression in both the case and set to 0 and 6 respectively.
dayOfWeek(variables('Start Date'))
Now if the condition true, we will check the date is a holiday or not, so for this in the If yes part, click on Add an action and select Get items action, provide the site address, list name, and in Filter query write the below query:
Date eq '@{variables('Start Date')}'
Next, we will calculate the length of get items value, so click on the next step and select Compose action. Then provide the below expression:
length(body('Get_items_-from_holiday_list')?['value'])
Next, add a condition to check the length is 0 or not. If the condition is true we will increment the counter variable by 1.
Next outside the Do until loop click on the Next step and select Set variable action. Then select Due date and in value select the Start date from dynamic content.
Next, we will update the due date in the SharePoint list, so click on the Next step and select Update item action. Then provide the site address list name and map the value like below.
Now click on Save and to run a flow, create an item in the task list, and it will automatically update the due date.
This is an example of Power Automate add business days to date.
Related Power Automate articles:
- Send a Happy Birthday email to employees using Microsoft Flow in SharePoint Online
- Send a reply when a new email arrives on Gmail using Power Automate
- How to get SharePoint list items using Rest API in Microsoft Power Automate
- Move files from OneDrive for Business to SharePoint Online
- Microsoft Flow Example: Copy files from one SharePoint Online account or folder to another
- Microsoft Flow Example Save tweets that include specific hashtag to a SharePoint list
- How to Check If a Date is Blank in Power Automate?
In this Power Automate tutorial, we learned Power Automate add days function. And also we discuss the below points:
- Power Automate add days function
- Power Automate add days to date column
- Power Automate add days to date format
- Power Automate add days to date variable
- Power Automate add days to due date
- Power Automate add days to current date
- Power Automate add business days to date
- Power Automate add 365 days to date
- add 2 days to date in power automate
- power automate add one day to date
- power automate add days to start date
- power automate add days exclude weekends
- power automate add days negetive
- power automate add days to datetime
- power automate add days to created date
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.
I have built a child flow that can add/subtract days excluding weekends and holidays. You can download the solution from my google drive https://drive.google.com/drive/folders/1HEVagrAcCfRlcK6PYTIMsj-bYH10zdyh. Also, you can check how it works here https://youtu.be/zPKEGT03AZE.
If you need o customize holidays or your working week starts from Sunday, just update the “Configuration” variable.