Trigger load in logic app

Shambhu Rai 1,411 Reputation points
2022-09-22T05:51:06.697+00:00

Hi Expert,

How to trigger load on 2nd Friday on every month in 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,542 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2022-09-22T06:56:28.93+00:00

    @Shambhu Rai Thanks for reaching out. There is no out of box solution for your requirement to configure in the schedule trigger. You need to have your custom condition to validate if today's day is the 2nd Friday of the month or not. You can leverage the different date and time function that are available in logic app such as dayOfWeek, dayOfMonth etc as per your requirement and valid and based on the condition you need to now write your workflow inside the true condition.

    For your reference sharing the condition to check whether it is 2nd Friday or not of the month.

    The first condition check whether today's day is Friday or not (i.e. Sunday is 0 so Friday will be 5)
    The second and third condition get the day of the month and divide it by 7 to get know if falls under greater than 1 or less than 2 (the condition will tell whether it is 2nd Friday or not)
    As these are and condition so all the condition should be true to run your true condition which will further have your workflow.

    I am using the timer trigger that runs every day on 10:00 am UTC. If you need to run in different time zone then you need to update the condition and configuration according to the time zone in your condition statement.

    243748-image.png

    Code View:

    {  
        "definition": {  
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",  
            "actions": {  
                "Condition": {  
                    "actions": {},  
                    "expression": {  
                        "and": [  
                            {  
                                "equals": [  
                                    "@int(dayOfWeek(utcNow()))",  
                                    5  
                                ]  
                            },  
                            {  
                                "greater": [  
                                    "@div(int(dayOfMonth(utcNow())),7)",  
                                    1  
                                ]  
                            },  
                            {  
                                "less": [  
                                    "@div(int(dayOfMonth(utcNow())),7)",  
                                    2  
                                ]  
                            }  
                        ]  
                    },  
                    "runAfter": {},  
                    "type": "If"  
                }  
            },  
            "contentVersion": "1.0.0.0",  
            "outputs": {},  
            "parameters": {},  
            "triggers": {  
                "Recurrence": {  
                    "evaluatedRecurrence": {  
                        "frequency": "Day",  
                        "interval": 1,  
                        "schedule": {  
                            "hours": [  
                                "10"  
                            ]  
                        }  
                    },  
                    "recurrence": {  
                        "frequency": "Day",  
                        "interval": 1,  
                        "schedule": {  
                            "hours": [  
                                "10"  
                            ]  
                        }  
                    },  
                    "type": "Recurrence"  
                }  
            }  
        },  
        "parameters": {}  
    }  
    

    Note: ** **Please validate it at your end and update the condition, as necessary.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful

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.