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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (2,668)