Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Play Date as Audio

    Posted 06-05-2025 18:43

    carchers9 | 2022-02-03 17:28:38 UTC | #1

    We have a call to an SQL database. The output from the Action Test is

    "Table1": [ { "DrawDate": "2022-02-02T00:00:00", "DrawNumber": 2205, "TmpsDrawName": "Night", "n1": "17", "n2": "19", "n3": "22", "n4": "27", "n5": "30", "n6": "04", "n7": "09", "n8": "28", "n9": "32", "n10": "35", "NextDrawJackpot": 123100000, "NextDrawJackpotRevancha": 135300000 }

    I can't figure out how to play the date in the call flow as DD Month 2022. I don't need the time. Everything that I have tried results in an error or plays out as 20220202. I can't use the system date because the date does not change base on the calendar day. It changes based on the draw time (i.e. TmpsDrawName": "Night" or TmpsDrawName": "Noon").


    78692638d4a24645fbf5 | 2022-02-03 18:30:34 UTC | #2

    If your variable is of DateTime type, then you have these available dropdowns.

    Based on what you are saying, something like this will read back "February Third Twenty Twenty Two".

    This is also a helpful reference: https://community.genesys.com/digestviewer29/viewthread?GroupId=19&MID=2754&CommunityKey=bab95e9c-6bbe-4a13-8ade-8ec0faf733d4&tab=digestviewer


    carchers9 | 2022-02-03 19:17:37 UTC | #3

    The draw date returns as a string in the output contract. I assign it Task.DrawDate in the Call Data Action.

    I cant use Data in the Play Audio, Task.DrawDate is greyed out. In addition the date would be wrong from midnight to noon. If you were to call the IVR between midnight and noon on Feb 3rd, you should hear the winning number and date of Feb 2nd's evening winning number draw. On Feb 3rd, at the noon draw, the date would change to Feb 3rd. We need to play the winning number and the date of the draw until the next draw.

    If you think about the lottery there maybe only 2 drawings a week. I need to play the same winning numbers and date until the next draw.

    ![Expression1

    690x461](upload://dffK1N03pxayvMQfWqdqaQjdcEo.png)

    ![expression2

    689x500](upload://mn81725uefFQUNjdV2IHJKkFqNw.png)

    ![Data

    546x500](upload://ou0xPShpjt0ropZEKwwGFLvsrjd.png)


    78692638d4a24645fbf5 | 2022-02-03 20:47:07 UTC | #4

    To convert that string to a DateTime data type, you would need to do something like this:

    If you need to play this value at a certain time of day, then you need to institute some logic to identify whether or not that DrawDate is before/after the compared Date. Heop that helps.


    carchers9 | 2022-02-03 22:19:01 UTC | #5

    Thank you for the responses!!!

    It doesn't really help me. Partly because, we are new to Genesys.

    It looks like you are hardcoding the date to 2022-02-02 in variable 1. The date retrieved from the SQL database would change everyday, just not at midnight.

    Are you saying that I need to create another variable in the update statement and compare it to the call data action return?

    ![CallDataAction

    417x499](upload://vcE8cbOK4awSdB4ti1DYKSGGlrE.png)

    ![update statement

    507x271](upload://9SOJnRRXHZHljV9Dzddvfl86wbO.png)


    Anton_Vroon | 2022-02-03 22:42:31 UTC | #6

    Carrying on from what has already been provided:

    You will need some logic to determine which Date in your list to get

    Use the Expression Helper to see your options under List, GetAt Find, FindFirst etc

    So as an example only, you might have a string called Task.DrawDate_Selected and the value might be GetAt(Task.DrawDate,0) Or you might set it to GetAt(Task.DrawDate,FindFirst(Task.TmpsDrawName,"Night")) (just be careful with findfirst if nothing found returns a -1, so might need some logic to capture that in an ifstatement to stop it erroring out)

    Whatever your business logic dictates, you might need to convert to a date first (next step) and then do a comparison to see if it is before or after a specific time.

    Then convert String to Date


    system | 2022-03-06 22:41:34 UTC | #7

    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: 13437