Genesys Cloud - Main

 View Only
Discussion Thread View
  • 1.  Data action output within script

    Posted 06-24-2020 19:01
    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.
    #Ask Me Anything (AMA)
    #Integrations
    #Routing(ACD/IVR)
    #Unsure/Other

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

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


  • 2.  RE: Data action output within script

    GENESYS
    Posted 06-25-2020 10:25
    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 06-25-2020 10:32
    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

    Posted 06-25-2020 16:55
    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

    Posted 06-25-2020 17:18
    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 06-26-2020 14:33
    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
    ------------------------------



  • 7.  RE: Data action output within script

    Posted 02-02-2023 18:24
    Hi - Curious if you were ever able to make it work or if there has been new functionality released for array variables in Scripter. 
    Thanks!

    ------------------------------
    Whitney Sandene
    Colorado Springs Utilities
    ------------------------------



Need Help finding something?

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