Genesys Cloud (formerly PureCloud)

Discussion Thread View
Expand all | Collapse all

Data action output within script

  • 1.  Data action output within script

    Top 25 Contributor
    Posted 7 days ago
    HI all

    I"m trying to create this in an inbound script:

    Variable1 = agent puts into input field
    Button = Calls a data action that takes Variable1 as it's only input
    Variable2 = text field that gets it's value from that data action called upon the button being pressed.

    My issue is when setting the data action against the button I can't seem to select the output variable to be Variable2.  It doesn't find any variables I"ve setup and when I click on the "Create New Variable" link it just closes the click action down.  I've tried manually adding the variable but the output variable list still comes up blank.

    Am I missing something or is this type of thing not possible?

    I'm hoping to expand on that and make the data action get called upon page/script load.
    #AskMeAnything(AMA)
    #Integrations
    #Routing(ACD/IVR)
    #Unsure/Other

    ------------------------------
    Vaun McCarthy

    ------------------------------


  • 2.  RE: Data action output within script

    GENESYS
    Posted 7 days ago
    I don't have time to play with it, but have you ensured the new variable you create is marked for Input (since it is coming back to the script from the Data Action)?

    ------------------------------
    George Ganahl GCP (Genesys Cloud), ICCE
    Principal Technology Consultant
    Genesys
    ------------------------------



  • 3.  RE: Data action output within script

    GENESYS
    Posted 7 days ago
    Actually...I did run a real quick check, and I don't think that's it.

    The main factor seems to be making sure the variable is the correct data type to match the output of the Data Action. For example, I have a Data Action where the output is a Number, so none of my variables would show up to select under Output.

    ------------------------------
    George Ganahl GCP (Genesys Cloud), ICCE
    Principal Technology Consultant
    Genesys
    ------------------------------



  • 4.  RE: Data action output within script

    Top 25 Contributor
    Posted 7 days ago
    Thanks George, I'll look at it from that angle.

    Side note also wondering how to handle a data action response in the script where the response may be an array/collection.  That doesn't seem to be a variable type available in scripter and I don't see a way to iterate through it.

    ------------------------------
    Vaun McCarthy
    NTT New Zealand Limited
    ------------------------------



  • 5.  RE: Data action output within script

    Top 25 Contributor
    Posted 7 days ago
    Thanks again George, I've taken a look and it's most definitely to do with the data type matching.  Where the data action returns a single object and not an array this works fine. But where it does return an array (which may only ever have one member/item) I now need to go and figure out how to iterate or list that within a script.

    ------------------------------
    Vaun McCarthy
    NTT New Zealand Limited
    ------------------------------



  • 6.  RE: Data action output within script

    GENESYS
    Posted 6 days ago
    I don't know...just hazarding a guess...perhaps use a Dynamic Variable and set the value using the Matrix, Index function described on https://help.mypurecloud.com/articles/expression-syntax-and-functions/

    Scripter does not handle array variables, so I'm not too hopeful. Index starts at 0.

    ------------------------------
    George Ganahl GCP (Genesys Cloud), ICCE
    Principal Technology Consultant
    Genesys
    ------------------------------