Logic app to run on 3rd Saturday and sunday of each month at 9 am and 9 pm

Azuretech 90 Reputation points
2023-09-05T12:01:28.6566667+00:00

How to define the logic to run Logic app on 3rd Saturday and sunday of each month at 9 am and 9 pm. It should not run every week . only on 3rd week of the month and on sat and sunday.

Can we achieve this using just one logic app

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,566 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-09-05T15:08:37.1+00:00

    Azuretech Thanks for posting your question in Microsoft Q&A. For your scenario, you can use Recurrence trigger, with the following conditions:

      1. Configure frequency as week, and then choose schedule hours, minutes, weekdays as follows:
    {
      "type": "Recurrence",
      "recurrence": {
        "frequency": "Week",
        "interval": 1,
        "schedule": {
          "hours": [
            "9",
            "21"
          ],
          "minutes": [
            0
          ],
          "weekDays": [
            "Saturday",
            "Sunday"
          ]
        },
        "timeZone": "Eastern Standard Time"
      },
      "conditions": [
        {
          "expression": "@equals(add(div(dayOfMonth(utcNow()),7),1),3)"
        }
      ]
    }
    
    • Then add conditions with an expression to validate if it is third week. The logic is to get the day of the month, divide by 7, which gives us the week of the month, then add a condition to look if it is third week. For example, you are looking for 2nd week, you will need to adjust like @equals(add(div(dayOfMonth(utcNow()),7),1),2). Check out Trigger conditions doc for more info.

    Note: the above snippet is just for reference and please validate to make sure all your conditions are met and adjust the expressions accordingly for your need. I hope this helps and let me know if you have any questions.


    If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.