Hi Nanden and Venkat,
Thanks for your replies.
The solution found was multiple if conditions as suggested by @Nandan Hegde
- SetVariable - Day1
- If condition - CheckWeekday
@contains(
'12345'
string(dayOfWeek(startOfMonth(utcNow())))
)
2a. If true - setVariable for BusinessDay = Day1
- If condition - CheckSaturday
@contains(
'6'
string(dayOfWeek(startOfMonth(utcNow())))
)
3a. If true - setVariable for BusinessDay = addDays(Day1,2)
- If condition - CheckSunday
@contains(
'0'
string(dayOfWeek(startOfMonth(utcNow())))
)
4a. If true - setVariable for BusinessDay = addDays(Day1,1)
- If Condition - BusinessDay=Today
5a. If true - execute secondary pipeline which will trigger alert.
So this initial pipeline can have a scheduled trigger running from days 1-5 each month, but only trigger the alert pipeline once a month.
However, decided to create a table in sql with columns: day,weekday,weekend,start_quarter and start_year. Then use until activity to check when weekday is flagged as true.