How to create a variable in an Update Statement for Week of Month

We have a client that wants to route after hours calls on the 4th Wednesday of the Month between 5 - 7 pm to a special menu.

In our "Update Data" section, we have an Update Statement with the Variable Name "Flow.DateToday" and Value to Assign as "AddHours(Flow.StartDateTimeUtc,-4)".

Next, in our "Decision" section, our expression is "(DayOfWeek(Flow.DateToday) == 4) and (Hour(Flow.DateToday) >= 17) and (Hour(Flow.DateToday) < 19)".

So, this works for every Wednesday, but we need help creating an expression for every 4th Wednesday.

Use the GetDayOfWeekOccurrence function.

GetDayOfWeekOccurrence(4, 4, Year(Task.DateToday), Month(Task.DateToday))

will get the 4th Wednesday of the current month. To see if that is today:

Day(GetDayOfWeekOccurrence(6, 3, Year(Task.DateToday), Month(Task.DateToday))) == Day(Task.DateToday)

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.