Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  How we can run loop for specific time, like for 5 min or 10 mins.

    Posted 11-16-2023 06:55
    Edited by Abhinesh Gupta 11-17-2023 16:37
    No replies, thread closed.


    ,



  • 2.  RE: How we can run loop for specific time, like for 5 min or 10 mins.

    Posted 11-16-2023 09:52
    No replies, thread closed.

    Can someone help



    ------------------------------
    Abhinesh Gupta
    Alight Solutions LLC
    ------------------------------



  • 3.  RE: How we can run loop for specific time, like for 5 min or 10 mins.

    Posted 11-17-2023 00:55
    No replies, thread closed.
    If you're referring to the in-queue flow and setting a wait time before doing something, you'll want to leverage the hold music object and set the time there.  
    You can set hold music before or after a loop starts. 


    ------------------------------
    Carlos Albor
    Senior Principal PS Consultant
    ------------------------------



  • 4.  RE: How we can run loop for specific time, like for 5 min or 10 mins.

    Posted 11-17-2023 14:37
    Edited by Abhinesh Gupta 11-21-2023 05:08
    No replies, thread closed.

    .I am looking for iteration of one value which has splited from the inserted  table array loop that need to be run for specific minute through the loop.



  • 5.  RE: How we can run loop for specific time, like for 5 min or 10 mins.
    Best Answer

    Posted 11-17-2023 15:36
    No replies, thread closed.

    Abhinesh, 

    You can leverage the GetCurrentDateTimeUtc() to set the initial time to a unique variable, with an additional AddMinutes(5).  Then enter the loop with an "unlimited" loop integer like 100.  Play your Text to Speech prompt then update a different variable with the current date time without +/- modifications.  Then evaluate the two $Task.InitialDateTime >= $Task.CurrentDateTime.  In the true path add an exit loop object.  In the false path, do nothing.  It should repeat until the $Task.CurrentDateTime is equal to or greater than the $Task.InitialDateTime.  

    Here are the particulars.  
    • Update Data
      • Task.InitialDateTime
        • Expression: AddMinutes(AddHours(GetCurrentDateTimeUtc(),-6),5)
          • GetCurrentDateTimeUtc()  returns the current date and time but in UTC
          • AddHours(GetCurrentDateTimeUtc(),-6)  returns the current date in UTC, AddHours adds -6 hours to represent CST (-5 for EST)
          • AddMinutes(AddHours(GetCurrentDateTimeUtc(),-6),5)  returns the current date in UTC AddMinutes adds +5 minutes.  Then the time zone adjustment.  Note: if you don't plan on posting these datetime variable values to participant data, you don't need to include the include the time zone adjustment. 
    • Loop Start
      • Task.LoopCount
        •  Max Loop Count 100 or which ever integer you feel is sufficient. 
    • Play Audio
      • Text To Speech
        • "Listen to this prompt for 5 minutes."
      • Barge-In: Disabled
    • Update Data
      • Task.CurrentDateTime
        • Expression: AddHours(GetCurrentDateTimeUtc(),-6)
    • Decision
      • Evaluate Expression:  Task.CurrentDateTime >= Task.InitialDateTime
      • True Path:
        • Exit Loop
      • False Path:
        • Nothing.  Allow it to loop again. 

    I created a POC for you to import and evaluate the logic.  We can't upload .yaml or .i3inboundflow file types.  After you download the attachments, restore the file extensions back to the respective file type.  (.txt  to .yaml and .txt to .i3inboundflow)

    I hope this helps you. 



    ------------------------------
    Carlos Albor
    Senior Principal PS Consultant
    ------------------------------