Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Using Intervals in Data Actions

    Posted 09-19-2025 16:59

    Hi all, I am looking for assistance with creating variable in Architect to pass to a data action for an API that requires an interval. I am looking to create a data action using the /api/v2/analytics/conversations/details/query API to get the total number of calls for the current day received from the ANI of the current call. I want to create a variable in architect for the current day that I can pass as an input to the data action.

    Appreciate any assistance with this request, 


    #Architect
    #DataActions
    #Integrations

    ------------------------------
    Scott Stewart
    ------------------------------


  • 2.  RE: Using Intervals in Data Actions

    Posted 09-19-2025 18:06

    Hey Scott,

    You can use the GetCurrentDateTimeUtc() function to get the Current Date.

    You can also use it in conjunction with the AddHours() function to offset some hours from the UTC, accordingly with your timezone.

    The end result should be something like that: AddHours(GetCurrentDateTimeUtc(),-3) - For a "-3 timezone".

    -----

    The output from that function is a "DateTime" value, that you can convert to a string (by using toString(), or by simply using the function to update a String Variable).

    The value should look like this: 2025-09-19T18:55:23.000Z

    Then, you can use some other functions, like Substring(), to extract just the start of the above string (The date part), and you can manually add the hours as "00:00:00", or any other starting hours, as needed on your timezone. 

    So you should do something like:

    Your_String_Variable = Substring(Your_String_Variable,0,10) + "00:00:00". (or the appropriate hours)

    Then for the end of your intervall, you can just take the above string and add "1 day", something like:

    AddDays(ToDateTime(your_string_variable),1)

    -----

    For the interval, remember to also put a "/" between the startTime and endTime.

    Keep in mind that for the Analytics API you should use the interval without the "timezone offset" applied. So for my timezone (-3), the current day interval would look like this: "2025-09-19T03:00:00.000Z/2025-09-20T03:00:00.000Z".

    -----

    Hope it helps!



    ------------------------------
    Marcello Jabur
    ------------------------------