Legacy Dev Forum Posts

 View Only

Sign Up

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

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

    Posted 06-05-2025 19:09

    Chris_Peters | 2018-07-19 23:59:01 UTC | #1

    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.


    MelissaBailey | 2018-07-20 13:58:51 UTC | #3

    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)


    system | 2018-08-20 13:58:53 UTC | #4

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


    This post was migrated from the old Developer Forum.

    ref: 3211