cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kouliscon
Helper V
Helper V

flow to find the date of the day Monday from the last week of the month and put it at a filed in SHarePoint Online list column

Hello,

 

i am looking for a flow to run every 1st of the month and to calculate the below:

 

  • the date of the day of Monday from the last week of the current month
  • the date of the day of Tuesday from the last week of the current month
  • ...........

 

Flow will run once every 1st of the Month and will replace the values.

 

let me know your thoughts and thank you

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @kouliscon

Based on the issue that you mentioned, do you want to update the SharePoint list with the Monday from the last week of the month?

I have seen that @Mira_Ghaly has provided you with a great solution of the Monday from the last week of the month.

Here is a little bit difference between us, I will post mine for your reference. In addition, if you only want to trigger the flow on the first day of the month, and update the last Monday date to the SharePoint list, please check as below:

vqiaqimsft_0-1627012074808.png

vqiaqimsft_1-1627012217414.png

Expression1:

 

dayofweek(startOfMonth(utcNow()))

 

Expression2:

 

subtractFromTime(startOfMonth(addToTime(utcNow(), 1, 'month')), 1, 'day')

 

Expression3:

 

dayOfWeek(outputs('last_day_of_the_month_2'))

 

Expression4:

 

addDays(outputs('last_day_of_the_month_2'), sub(1, outputs('Weekday_of_the_first_day_of_the_month_2')), 'MM-dd-yyyy')

 

Add a Create item action as below and populate the date column with the correct output:

vqiaqimsft_2-1627012434513.png

 

 

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @kouliscon

Based on the issue that you mentioned, do you want to update the SharePoint list with the Monday from the last week of the month?

I have seen that @Mira_Ghaly has provided you with a great solution of the Monday from the last week of the month.

Here is a little bit difference between us, I will post mine for your reference. In addition, if you only want to trigger the flow on the first day of the month, and update the last Monday date to the SharePoint list, please check as below:

vqiaqimsft_0-1627012074808.png

vqiaqimsft_1-1627012217414.png

Expression1:

 

dayofweek(startOfMonth(utcNow()))

 

Expression2:

 

subtractFromTime(startOfMonth(addToTime(utcNow(), 1, 'month')), 1, 'day')

 

Expression3:

 

dayOfWeek(outputs('last_day_of_the_month_2'))

 

Expression4:

 

addDays(outputs('last_day_of_the_month_2'), sub(1, outputs('Weekday_of_the_first_day_of_the_month_2')), 'MM-dd-yyyy')

 

Add a Create item action as below and populate the date column with the correct output:

vqiaqimsft_2-1627012434513.png

 

 

Best Regards,
Qi
kouliscon
Helper V
Helper V

@v-qiaqi-msft thank you for the great info

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,357)