azure-data-factorydynamic-content

Add dynamic content to pass a parameter to get last 03 days if today is Monday in Azure Data Factory


i want to pass dynamic content to a parameter in "Execute SSIS Package" to pass If sysdate= monday then get last 3 days Can someone help to build the content using functions or expression enter image description here

Thanks


Solution

  • There are 2 ways you can achieve this.

    1. Use an IF activity to first check if today is a Monday. You can use an expression like @equals(dayOfWeek(utcnow()),1) for a Monday check. If true, get utcNow() - 3 days using a dynamic content of @adddays(utcnow('yyyy-MM-dd'),-3). You may need to change the format to what you need.

    2. Easier and more efficient option, just schedule your pipeline to run every Monday. Then there is no need to check anything. enter image description here