Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Calculate Dates

    Posted 06-14-2023 17:38
    No replies, thread closed.

    we have a date in this formation 2023-04-11 and we want to calculate 5 days from there - any thoughts how we could do a decision


    #ArchitectureandDesign

    ------------------------------
    Marilyn CAMbria
    Becton Dickinson and Company
    ------------------------------


  • 2.  RE: Calculate Dates

    Posted 06-14-2023 18:10
    No replies, thread closed.

    To do any sort of DateTime comparison you need to be using a DateTime variable.

    So convert your string to DateTime, So assuming the string is always in the format yyyy-mm-dd function might look like

    MakeDateTime(Left(Task.Date,4),Substring(Task.Date,5,2)Right(Task.Date,2))

    And then you can do AddDays(Task.DateTime, 5) or all combined is AddDays(MakeDateTime(Left(Task.Date,4),Substring(Task.Date,5,2)Right(Task.Date,2)),5)

    So then you can just compare that to Flow.StartDateTimeUtc, so for example AddDays(MakeDateTime(Left(Task.Date,4),Substring(Task.Date,5,2)Right(Task.Date,2)),5) >= Flow.StartDateTimeUtc

    Or ideally put that into its own variable so just Task.FiveDaysFromDate >= Flow.StartDateTimeUtc



    ------------------------------
    Anton Vroon
    ------------------------------



  • 3.  RE: Calculate Dates

    Posted 06-15-2023 08:14
    No replies, thread closed.

    Thank you



    ------------------------------
    Marilyn CAMbria
    Becton Dickinson and Company
    ------------------------------



  • 4.  RE: Calculate Dates

    Posted 06-15-2023 04:00
    No replies, thread closed.

    If the date is already in yyyy-mm-dd format you can use ToDateTime("yyyy-mm-dd") which makes it a bit cleaner.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 5.  RE: Calculate Dates

    Posted 06-15-2023 08:15
    No replies, thread closed.

    Thank you



    ------------------------------
    Marilyn CAMbria
    Becton Dickinson and Company
    ------------------------------