11-02-2018 04:38 AM
I have a number of session variable
Example:
{Data.Session.S_E1} = 100
{Data.Session.S_E2} = 200
{Data.Session.S_E3} = 300
And I want to find the value of one of the above using a digits element.
So if caller enters digits of "1", I can set a new session variable "NewVariable" to be the value of {Data.Session.S_E{Data.Element.Digits.value}}
So the value of this variable would be "100"
However this does not work - this just sets the new variable to the string Name of the session variable.
NewVariable = "{Data.Session.S_E1}"
Rather than
NewVariable = "100"
Is what I want possible to do?
I can work around the issue - but this would be a neater solution.
Regards,
Gerry
11-02-2018 10:06 AM
This will not work. It's nothing on Call Studio, this is how Java in general works.
The code you enter is translated in a single evaluation step. You'd be better off using a Map data structure or a custom Java element to do something really fancy.
Trying to use one variable's value as part of another variable's name is not possible. Some true scripting languages, maybe, but not here.
11-05-2018 04:28 AM
11-05-2018 02:35 PM
So honestly this can be done. However, I would need to see your Vxml Call flow script ... but based off your original requirement in the post why not just log every session variable and look in the activity logs of what that value is? This way you don't have to make things super complicated.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide