cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Towaiji
Helper II
Helper II

Auto Increment - Date

Hello there

 

So recently i've learned how to auto increment numbers from a list.

 

Now how can I do the same but with date? and preferably count only week days!

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @Towaiji ,

 

You could refer to screenshot below to create the flow:

1.png

Note:

1.Create a Date type column in an item in a list.

2.Save the date from the column in a Compose action.

3. Get the next workday of the date with expression below:

if(equals(dayOfWeek(outputs('Compose')),5),addDays(outputs('Compose'),3),if(equals(dayOfWeek(outputs('Compose')),6),addDays(outputs('Compose'),2),addDays(outputs('Compose'),1)))

4.Format the date:

formatDateTime(outputs('Compose_2'),'yyyy-MM-dd')

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
efialttes
Super User III
Super User III

Hi!

You can use addDays() or convert date and time in ticks()

But, if you need to add weekdays only, you should apply a more sophisticated approach, as explained in this thread

https://powerusers.microsoft.com/t5/Building-Flows/Calculating-Business-days-using-flows/td-p/315402

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



v-alzhan-msft
Community Support
Community Support

Hi @Towaiji ,

 

You could refer to screenshot below to create the flow:

1.png

Note:

1.Create a Date type column in an item in a list.

2.Save the date from the column in a Compose action.

3. Get the next workday of the date with expression below:

if(equals(dayOfWeek(outputs('Compose')),5),addDays(outputs('Compose'),3),if(equals(dayOfWeek(outputs('Compose')),6),addDays(outputs('Compose'),2),addDays(outputs('Compose'),1)))

4.Format the date:

formatDateTime(outputs('Compose_2'),'yyyy-MM-dd')

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

 

my bad, let me try now

 

Hi!
One problem is with Compose, compose 2 and Compose 3 icurrent inputs... you need to follow these steps to add suggested expressions
https://flow.microsoft.com/es-es/blog/use-expressions-in-actions/
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Early morning.. I can't believe i just put it as input not expression haha and im wondering what's going on!!!!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (4,193)