Genesys Cloud - Main

 View Only


Discussion Thread View
  • 1.  Data Action returning null value breaks call

    Posted 7 days ago

    I have a data action in an inbound voice call flow to pass the contact ID and return a custom contact dropdown ID from from a data action. 

    If an external contact has an option selected in the drop down I get back the key value and it works fine. 

    However, if nothing is selected the call ends with "Code Sorry an error occurred. please try you call again."

    The flow doesn't appear to take the Call Data action Failure or Timeout paths. It just plays the error message and ends the call. 

    I'm thinking the error is because the system is trying to assign a null value to a string variable. 

    Even then, I'm not sure why the Call Data Action would not take the failure route. 

    Has anyone had similar experience? Any ideas how to return a value that is occasionally null? 


    #ArchitectureandDesign

    ------------------------------
    Kenny
    ------------------------------


  • 2.  RE: Data Action returning null value breaks call

    Top 25 Contributor
    Posted 6 days ago

    Hi Kenneth,

    When you run the Data Action in test mode in the Data Action configuration space.

    Do you get a successful result, or failed result there?

    Have you tried to assign a default value in the DataAction success template?

    Does your flow error handling disconnect calls? In error handling I generally prefer to send to a default queue to mitigate customer impact.



    ------------------------------
    Anton Vroon
    ------------------------------



  • 3.  RE: Data Action returning null value breaks call

    Posted 6 days ago
    Edited by Kenneth Ely 6 days ago

    Anton, 

    If I run data action in test mode with the default response, it runs successfully. If there is something in the field, I get the value. If there isn't anything in the field, the data action still runs successfully, it just doesn't return the field or value. 

    {
      "translationMap": {},
      "translationMapDefaults": {},
      "successTemplate": "${rawResult}"
    }

    I have built out a new version of the data action with the below with a success template and default value. I'm not getting error on the template, but I'm still not getting a good result. Testing the new data action the field for dedicatedcss_enum always shows up, but it is blank. If I open the Json, it shows my default value of "DEFAULT_VALUE".

    {
      "translationMap": {
        "dedicatedcss_enum": "$.dedicatedcss_enum"
      },
      "translationMapDefaults": {
        "dedicatedcss_enum":"\"DEFAULT_VALUE\""
      },
      "successTemplate": "{ \"dedicatedcss_enum\": $dedicatedcss_enum}"
    }

    Error handling in the flow explains why I got the disconnect. A default transfer to queue is a better option. 



    ------------------------------
    Kenneth Ely
    Unified Communications Engineer
    ------------------------------



  • 4.  RE: Data Action returning null value breaks call
    Best Answer

    Top 25 Contributor
    Posted 3 days ago

    Hi Kenneth,

    I'll take a look at why you are not getting the result assigned to your output a little later today, since at first glance it should assign the default value to your variable without issue.

    But If it successfully runs, it will be going down the success path in architect flow regardless. Assigning nulls / empty values shouldn't be an issue there. What is an issue though is if you have any logic or conditional statements on that success path, eg if task.dedicatedcss_enum == "xyz" then that will error out when the value is empty. Genesys doesn't natively handle any operands where there is empty/null values and errors out. 

    Two ways around this, on the data action output assignment, provide a default value for the outputs in architect.

    The other is liberal use of IsNotSetOrEmpty(), either in a decision block to handle the cases when it is empty, or in variable assignment, eg If(IsNotSetOrEmpty(task.dedicatedcss_enum), "Default Value", task,dedicatedcss_enum)



    ------------------------------
    Anton Vroon
    ------------------------------



  • 5.  RE: Data Action returning null value breaks call

    Posted 3 days ago

    Anton, 

    You were right, the data action wasn't breaking the flow, the logic right after the success was. Adding logic to check if the variable is null in the next step corrected the issue.  

    I used update data to set the variable to itself if it was populated, or to DEFAULT if it was null.

    If(IsSet(dedicatedcss_Variable), dedicatedcss_Variable, "DEFAULT"). 

    Thanks for your assistance. 



    ------------------------------
    Kenneth Ely
    ------------------------------



  • 6.  RE: Data Action returning null value breaks call

    Top 25 Contributor
    Posted 3 days ago

    Data Action not working: 

    Honestly all I could figure out is, it is due to the nested object that you have in your Output contract.

    If I do this instead

    Those variables get assigned correctly. If I put either under a nested object, it does not.

    But see my previous response. I don't think it is the outputs that is an issue in your case. If the data action is successful it is going down the success path. To show it is processing there, through a set participant data action as the first thing out on the success path, and you should see it in the attribute data. 

    It will be what you do afterwards that is causing it to go to error handling. There will likely be some operation, like a check if flow.dedicatedcss_enum > 0 or whatever the case may be, or an append, or something like that, and since the value is not set then it errors out. 

    Having either the data action return a default value, or having your architect flow handle the default value should do the trick.



    ------------------------------
    Anton Vroon
    ------------------------------



Need Help finding something?

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