Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Data actions inside a script.

    Posted 3 days ago

    Hi,

    I have an API built in architect where it does a GET to our web analytics provider to check the if the phone call came from their virutal numbers on our site. I pass the data action the caller id and it reutns if its a valid call and the call ref with some othe info. This is all fine. When the agent answers the call I screen pop a script there passsing those values to it and trying to get the agent name who answered the call to execute the data action to do the Post to the web analytics provider. 

    This is the problem. The variables look like they are being passed into the script but when the data action runs (after doing some debug work), it looks like that the variables are populated at UI but not 'real' variable that I can use to pass to the API.

    I need to the agent name and to pass back the few variables so that the web provider can show the name of the agent who took the call. 

    Is there any way to send or store the values for agent name and variables passed to the script from Architect so that they can be used in a call data action. 

    I am porbably not explaining it too well. 

    Thanks for any help


    #API/Integrations

    ------------------------------
    Jacquie Feeney
    NA
    ------------------------------


  • 2.  RE: Data actions inside a script.

    Posted 3 days ago

    Hi Jacquie,

    I think this may be better answered in the Genesys Cloud Developer Community so I will move this thread over so that the experts there can help



    ------------------------------
    Sam Jillard
    Online Community Manager/Moderator
    Genesys - Employees
    ------------------------------



  • 3.  RE: Data actions inside a script.

    Posted 3 days ago

    Hey Jacquie,

    Yeah, I'm not too sure I fully understood you. But I will try to give some insights here, maybe it helps you.

    1) I believe you are running a Data Action on your Architect Flow. Right? That's a GET API, and you are retrieving some data that you want to send to your script. Is that all correct?

    2) If that's correct, you should create some input variables on your script, and when you use "Set Screen Pop" action on your Flow, you will be able to pass that information to the Script input variables.

    3) Now, on your script... From what I understood, you want to run another Data Action, in this case a POST, and you want to pass the Agent Name as an input to that Action.. Right?

    In that case, there is a built-in variable with that information: {{Scripter.Agent Name}}

    So you just have to run the Data Action on your script, and use the above variable as the input for the Agent Name.

    Your other variables from your Flow (that you used as inputs for the script) can also be used there.

    --------

    I'm not sure if I understood what you needed.. But if it is what I mentioned above, it should work. But let me know if I missed any details.

    Maybe add some screenshots so we can check if there is anything missing: 

    • The way you created your script variables
    • The way you are sending the values to the script (Screen Pop on architect)
    • The way you are trying to run the second data action on the script


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



  • 4.  RE: Data actions inside a script.

    Posted 2 days ago

    Hi 

    Thank you

    Thats exactly it.

    Inside Architect it calls the Get Data action and i send the caller Id, the data action returns some fields , txr, igrp, dgrp and that is working perfectly.

    I then screen pop to the agent script and pass in the customer caller id along with trx,igrp, dgrp and it does seem to be passing it in correctly in the script.

    Inside the script is where i created a custom action to call the data action to Post the results sending the above variables and the scripter.agent name. 

    This is where it fails. I created a button in the script for testing and the button just spins so its like the data action is not running. 

    Inside the custom action, i added some degbug lines to see if the variables above were populated. 

    I made a test call and i can see that the variables are populated so i dont know why the data aciton is failing.

    Thank you

    I attached screen shot of the test call along with the custom action setup. 



    ------------------------------
    Jacquie Feeney
    NA
    ------------------------------



  • 5.  RE: Data actions inside a script.

    Posted 2 days ago

    Well, it seems that you are already on the right track for solving it, with all of those debugs giving you lots of information.

    The only thing I can suggest here is that you confirm the Data Action actually works outside of the script. Have you checked for that?

    Try to run the Data Action directly and pass the same values that you would be passing through the script. Make sure that is working.

    After that, maybe create a copy of your data action and set every input as a hard coded value (basically, remove every input variable and just set the values directly on the data action), and try to run that one on the script. If that one also doesn't work, then the issue is not related to the values you are trying to pass through the variables, but if it works, then you can try to add the variables back one by one and keep testing until you find out which of the variables are causing the issue.

    Oh.. there is something else that I just remembered, and it's most likely the issue... Confirm if that user (that is getting the call on the script) actually has the appropriate permissions to run data actions.

    Even though it's the script/system that is running the actions, I believe the agent has to have those permissions.

    You can check those permissions here as well: Look up data from an external source in scripts View summary - Genesys Cloud Resource Center



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



  • 6.  RE: Data actions inside a script.

    Posted 2 days ago

    Thank you for the reply Marcello

    I have tested the data action itself and entered the values there and it runs perfectly.

    I am checking the premissions now as they might be the missing piece!



    ------------------------------
    Jacquie Feeney
    NA
    ------------------------------



  • 7.  RE: Data actions inside a script.

    Posted 2 days ago

    WOW¬ Thank you. 

    That was it, The agent needed the premissions specified on the link above. 

    Its all working perfectly now. 

    Thank you again. 



    ------------------------------
    Jacquie Feeney
    NA
    ------------------------------



  • 8.  RE: Data actions inside a script.

    Posted 2 days ago

    No problem at all, glad that it worked!



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