cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rfeather89
Level: Powered On

Scheduling flow condition depending on x Thursday of the month

Hi,

 

I'm looking to build a flow which posts to Slack every Thursday with a different message depending on the week# of the month.

 

I.e:

 

Thursday 1: Message 1

Thursday 2: Message 2

etc.

 

I can get the schedule and post message to slack, however I can't find a way to have Flow determine which week of the month it is, any suggestions?

 

Thanks for any help in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Level 10

Re: Scheduling flow condition depending on x Thursday of the month

Hi @rfeather89 ,

I suggest you use the dayofMonth() function to get the day of the month.

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#d...

Then checking the return value.

If the value is during 1-7, post Message1.

If the value is during 8-14, post Message2.

If the value is during 15-21, post Message3.

If the value is during 22-28, post Message4.

If the value is during 29-31, post Message5.

Best Regards,

Community Support Team _ Zhongys

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
Super User
Super User

Re: Scheduling flow condition depending on x Thursday of the month

@rfeather89 

My usual caveat is: there is probably a more elegant way to do this, but this is one (easy) way to fix this.

 

So...I'm picturing a spreadsheet with the different messages, no?  Even if not, what do you think about having a spreadsheet with 3 columns:  [Date], [WeekNumber], [Message]

 

  • For the date, I just did a few Thursdays in a row and let Excel figure out the pattern for the next 100 or so rows.
  • Weeknumber is the Excel function WEEKNUM([Date])
  • And Message is your pre-programmed note.

If that works, then you could use a Get Row or something in Flow to get the corresponding row to today's date (you'd probably have to format it since I think the default is to include time, and then it won't ever match).

 

Let us know if that will suit your needs.

Good luck!

 

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

 

v-zhos-msft
Level 10

Re: Scheduling flow condition depending on x Thursday of the month

Hi @rfeather89 ,

I suggest you use the dayofMonth() function to get the day of the month.

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#d...

Then checking the return value.

If the value is during 1-7, post Message1.

If the value is during 8-14, post Message2.

If the value is during 15-21, post Message3.

If the value is during 22-28, post Message4.

If the value is during 29-31, post Message5.

Best Regards,

Community Support Team _ Zhongys

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

rfeather89
Level: Powered On

Re: Scheduling flow condition depending on x Thursday of the month

This seems to do the trick! meant a 5 conditional flow, but it works 🙂 Thank you!

rfeather89
Level: Powered On

Re: Scheduling flow condition depending on x Thursday of the month

I feel like this could work too, but I haven't had a whole lot of luck with Flow referencing Excel in sharepoint, plus it's always good to reduce dependancies where possible! Thank you 🙂

rfeather89
Level: Powered On

Re: Scheduling flow condition depending on x Thursday of the month

Here is a screenshot of how it looks, in case others come across this situation in the future....

 

 

image.png

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,615)