Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Digital Bot callback time slots

    Posted 10-26-2024 01:57
    Edited by Phaneendra Avatapalli 10-26-2024 02:49

    Hi everyone, 

    Could you please let me know if anyone was suceessful creating call backs based on timeslots like 8am to 9am ; 10 am to 11am and so on. 

    I can see that this idea https://genesyscloud.ideas.aha.io/ideas/CEWMM-I-458 may take some time to be implemented by Genesys.

    I'm currently trying to set this up using Genesys Data Cloud actions. While I was able to create a callback, I encountered issues when attempting to implement time slots. Below are screenshots of two flows I have tried:

    First flow- In this flow, I created a digital menu asking for time slots and set up data actions for different slots. However, this flow does not create a schedule. Instead, when I add the Call data action afterward, it triggers a callback immediately.



     The above flow doesn't create a schedule but as soon as I add the Call data action again after this it just does a callback straight away. 

    Flow 2: In this attempt, I started with the Call data action. If it succeeds, I then created a digital menu and directed it to different call data actions. Unfortunately, this also results in an immediate callback as soon as it hits the first data action.



    For the callschedule time under cloud data actions, I am using the following expression for the slots. The below expression is to create a call back between 10am to 11am the next day. 

    If(
        DayOfWeek(ToDate(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(0, 11, 0, 0)))) == 6,
        MakeDateTime(Year(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(3, 11, 0, 0))),
                      Month(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(3, 11, 0, 0))),
                      Day(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(3, 11, 0, 0))),
                      10, 0, 0),
        If(
            DayOfWeek(ToDate(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(0, 11, 0, 0)))) == 7,
            MakeDateTime(Year(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(2, 11, 0, 0))),
                            Month(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(2, 11, 0, 0))),
                            Day(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(2, 11, 0, 0))),
                            10, 0, 0),
            If(
                DayOfWeek(ToDate(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(0, 11, 0, 0)))) == 1,
                MakeDateTime(Year(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(1, 11, 0, 0))),
                                Month(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(1, 11, 0, 0))),
                                Day(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(1, 11, 0, 0))),
                                10, 0, 0),
                MakeDateTime(Year(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(1, 11, 0, 0))),
                                Month(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(1, 11, 0, 0))),
                                Day(AddDuration(GetCurrentDateTimeUtc(), MakeDuration(1, 11, 0, 0))),
                                10, 0, 0)
            )
        )
    )

    If anyone can assist with this, it would be greatly appreciated!

    Thank you in advance for your help.

    Regards,

    Phaneendra


    #DigitalChannels

    ------------------------------
    Phaneendra Avatapalli
    Client Support, Desktop Support
    ------------------------------



  • 2.  RE: Digital Bot callback time slots

    Posted 10-26-2024 05:15

    I can see that call back is scheduled using the flow 1 but it does on Monday at 9pm instead of doing it between 10 am to 11am 



    ------------------------------
    Phaneendra Avatapalli
    Client Support, Desktop Support
    ------------------------------



  • 3.  RE: Digital Bot callback time slots

    Posted 10-26-2024 16:44

    Hi Phaneendra,

    When using the data action to book a future callback you need to ensure the date/time is passed in UTC.

    You also may need to tweak your flow to do some time conversation and work properly with daylight savings based on your location. 

    There are some examples here:

    https://help.mypurecloud.com/articles/datetime-values-in-architect-flows-and-daylight-savings-time-dst-calculations/



    ------------------------------
    Paulo Mesquita
    Solutions Consultant
    ------------------------------



  • 4.  RE: Digital Bot callback time slots

    Posted 10-27-2024 04:41

    Hi Paulo,

    Thank you for assisting, I have tried changing the logic so many times still not able to achieve what I wanted to.

    I have spent so much time on this but was not able to get the right expression.

    Regards

    Phaneendra



    ------------------------------
    Phaneendra Avatapalli
    Client Support, Desktop Support
    ------------------------------



  • 5.  RE: Digital Bot callback time slots

    Posted 10-27-2024 20:52
    Edited by Phaneendra Avatapalli 10-27-2024 20:52

    Hi Paulo, I don't know if I did this correctly but I have created Update Data after the timeslot 10am to 11am. 

    Added a varaible = Flow.LocalDateTime
    Expression to calculate DST - 
    If(
        Flow.StartDateTimeUtc < GetDayOfWeekOccurrence(1, -1, Year(Flow.StartDateTimeUtc), 10, 1, 2, 0),
        AddHours(Flow.StartDateTimeUtc, 11), 
        If(
            Flow.StartDateTimeUtc < GetDayOfWeekOccurrence(1, -1, Year(Flow.StartDateTimeUtc), 4, 1, 3, 0),
            AddHours(Flow.StartDateTimeUtc, 11), 
            AddHours(Flow.StartDateTimeUtc, 10)
        )
    )


    Then I have the call data action where I had the below expression to schedule a call back between 10am to 11am. If Saturday or Sunday it should callback next day instead of doing it 10am next day since today is a Monday it schedules the callback today itself at 9pm. I don't what I am doing wrong. 

    If(
        DayOfWeek(Flow.LocalDateTime) == 7,
        MakeDateTime(Year(AddDays(Flow.LocalDateTime, 2)), Month(AddDays(Flow.LocalDateTime, 2)), Day(AddDays(Flow.LocalDateTime, 2)), 10, 0, 0),
        If(
            DayOfWeek(Flow.LocalDateTime) == 1,
            MakeDateTime(Year(AddDays(Flow.LocalDateTime, 1)), Month(AddDays(Flow.LocalDateTime, 1)), Day(AddDays(Flow.LocalDateTime, 1)), 10, 0, 0),
            If(
                Hour(Flow.LocalDateTime) < 10,
                MakeDateTime(Year(Flow.LocalDateTime), Month(Flow.LocalDateTime), Day(Flow.LocalDateTime), 10, 0, 0),
                If(
                    Hour(Flow.LocalDateTime) >= 11,
                    MakeDateTime(Year(AddDays(Flow.LocalDateTime, 1)), Month(AddDays(Flow.LocalDateTime, 1)), Day(AddDays(Flow.LocalDateTime, 1)), 10, 0, 0),
                    MakeDateTime(Year(Flow.LocalDateTime), Month(Flow.LocalDateTime), Day(Flow.LocalDateTime), 10, 0, 0)
                )
            )
        )
    )




    ------------------------------
    Phaneendra Avatapalli
    Client Support, Desktop Support
    ------------------------------



  • 6.  RE: Digital Bot callback time slots
    Best Answer

    Posted 10-28-2024 09:31

    Phaneendra,

    I am sorry, but I do not currently have availability to dig into your expressions and help...however, I suggest that you enable gathering of Execution Data for your flow at the Notes level (or higher) so you can see what values are being assigned to your variables. That way you can see what is being calculated, and that should give you insights on what is going wrong.

    https://help.mypurecloud.com/articles/historical-execution-data-overview/



    ------------------------------
    George Ganahl GCP, GCSME, ICCE, ICHD, etc.
    Senior Principal PS Consultant
    Genesys
    ------------------------------



  • 7.  RE: Digital Bot callback time slots

    Posted 10-29-2024 20:29

    Thank you George for your assistance.



    ------------------------------
    Phaneendra Avatapalli
    Client Support, Desktop Support
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources