cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
775
Views
15
Helpful
3
Replies

CVP Call Studio - Nested Variable value within a session variable?

Gerry O'Rourke
Spotlight
Spotlight

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

 

3 Replies 3

Quigath
Spotlight
Spotlight

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.

ptindall
Cisco Employee
Cisco Employee

Gerry,

 

You can use a custom element such as the one attached for copying element data to a destination variable, the name of which supports substitution.  Not tried it but you might also be able to achieve it using the Local variable and Javascript approach.

PaulMil
Level 1
Level 1

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: