cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sam_sonepar
Helper III
Helper III

Get all dates for next month

Hi,

 

Currently, I have a flow that runs every Saturday.

It gets items from a Lookup SharePoint list and depending on the information in it, it will populate my Main SharePoint list with the appropriate information.

 

The goal here is to automate the entry of information for some recurring appointments.

For example, if Monday and Friday are "turned on" in my Lookup List, the Flow will add 2 items on my Main List for the next Monday and Friday.

If the flow runs on any day of the week of October 25 2020, the item with Monday selected, will be on November 2nd and Friday will be November 6. If the Flow kicks in on the week of November 2nd, the date will be for the following week and so on.

 

The formula for Monday is: 

addDays(utcNow(), if(equals(dayOfWeek(utcNow()), 0), 1, sub(8, dayOfWeek(utcNow()))), 'yyyy-MM-dd')

The formula for Friday is:

addDays(utcNow(), if(equals(dayOfWeek(utcNow()), 0), 1, sub(12, dayOfWeek(utcNow()))), 'yyyy-MM-dd')

 

Currently, the flow tackles week to week and works just fine. Now I need to have the flow run on a monthly basis.

It would be trigger on November 1st and fill out the information for the entire month of December. Then would be triggered on December 1st and fill out for the month of January and so on.

So if Monday is "turned on" in my SharePoint LookUp List, I need the Flow to populate my main list with all the Mondays in December.

 

Thank you!1.PNGThere is a "Scope" for every day of the week in order to analyze every working day.There is a "Scope" for every day of the week in order to analyze every working day.In the scopes, the actions are all the same, except for the Compose Date that varies by 1 number.In the scopes, the actions are all the same, except for the Compose Date that varies by 1 number.

 

Screenshots Side Notes

Minute and Hour Integer is used to convert my numbers from String to Integer in order to later convert them into a date.

Compose T, TH & THM is used to add hours and minutes to the time.

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,394)