Genesys Cloud - Main

 View Only

Sign Up

  • 1.  Need Help Filtering and Converting API Date Formats

    Posted 5 hours ago

    Hi Team,

    I am receiving date formats from an API such as:
    "Nov 17, 2025 - Dec 17, 2025", "Nov 17,25", "Feb 2025-Dec 2025", "[Dec 19, 2025]", "[Nov 17, 2025 - Dec 17, 2025]", "[Feb 2025-Dec 2025]", "[Feb 2025]", "Feb 2025", etc.

    I want to consider only the following valid formats:
    Nov 12,25
    Nov 12,2025
    [Nov 17, 2025]

    All other formats should be ignored and treated as NOT_SET.

    I have tried a few approaches, but they are not working. Could someone please provide the correct expression/logic to achieve this inside a loop? After filtering, I also need to convert the valid values into a proper date format and 

    Play the Date format to the customer.


    #ArchitectandDesign

    ------------------------------
    Srikanth k s
    ------------------------------


  • 2.  RE: Need Help Filtering and Converting API Date Formats

    Posted an hour ago

    Hi Srikanth, I would handle this in Architect.

    My suggestion is to configure the Data Action to return the date value as raw data, without transforming it in the action. Then, inside the Architect loop, parse the returned string by breaking it into month, day and year.
    From there, you can validate only the expected formats, ignore ranges or unsupported values, normalize the brackets/spacing when needed, convert the month abbreviation to a number, adjust the year if it comes with two digits, and then rebuild it as a proper DateTime.
    After that, you can use ToAudioDate() or ToAudioDateTime() to play the date to the customer.
    I would only use a Genesys Cloud Function if this rule becomes more complex or needs to be reused across multiple flows. For this case, keeping the logic in Architect should be simpler and easier to debug.


    ------------------------------
    Att,
    Breno Canyggia Ferreira Marreco
    ------------------------------