Genesys Cloud - Main

 View Only


Discussion Thread View
  • 1.  use current date time in data action

    Posted 09-15-2023 14:56

    Hi all, 

      Trying to write a data action that returns whether a phone number has been called on an outbound campaign today. More then open to other ways, but the outbound campaign requires the resulting data be capable of saying true/false to  call having been done already.

    /api/v2/analytics/conversations/details/query

    This seems like a resonable API to return this data, as i can hard code the campaignID and pass the phone number in question as dnis. But the trouble is how do i define today as the interval?

    Is there a way in a data action to code in todays date/time? Or even better to add it in and subtract say 16 hours to create a window of time for the interval input?

    WIP example of just the api, the interval is where this method falls down because it can't be hard coded

    {
     "interval": "2023-09-01T01:01:01/2023-09-15T01:01:01",
     "order": "desc",
     "orderBy": "segmentEnd",
     "paging": {
      "pageSize": 1,
      "pageNumber": 1
     },
     "segmentFilters": [
      {
       "type": "and",
       "predicates": [
        {
         "type": "dimension",
         "dimension": "dnis",
         "operator": "matches",
         "value": "17192223333
        },
           {
         "type": "dimension",
         "dimension": "outboundCampaignId",
         "operator": "matches",
         "value": "75681842-3d5e-47f1-9d4a-e0eeb59381f3"
        }
       ]
      }
     ]
    }


    #Integrations

    ------------------------------
    William Tracy
    Angi
    ------------------------------


  • 2.  RE: use current date time in data action

    Posted 09-23-2023 23:59

    Seems to me something like this would work:  Append(ToString(GetCurrentDateTimeUtc()),"/",ToString(AddHours(GetCurrentDateTimeUtc(),-16)))

    Now what you probably want is the actual current time depending on your time zone and subract from there, but should still be similar. 



    ------------------------------
    Robert Wakefield-Carl
    ttec Digital
    Sr. Director - Innovation Architects
    Robert.WC@ttecdigital.com
    https://www.ttecDigital.com
    https://RobertWC.Blogspot.com
    ------------------------------



Need Help finding something?

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