This document was generated from CDN thread
Created by: Kristian Martell on 23-07-2012 09:50:56 AM
I have a scenario where I will be returned a set of
variable data from a REST look up. This data will be returned as session data
and with the VariableName followed by a number. i.e. CurrBalance1,
CurrBalance2. Each of these will contain data returned by the REST get and will
need to be played back using Say-It-Smart. My question is this, how can I create
the variable name using substitution so that the last piece can be variable?
For example {Data.Session.(CurrBalance+{Data.Element.Counter_01.value})}
Subject: RE: New Message from Kristian Martell in Customer Voice Portal (CVP) - Gene
Replied by: GEOFFREY THOMPSON on 23-07-2012 10:26:45 AM
You could use the old Arithmetics.jar published on the Audium forum before the acquisition by Cisco to do simple arithmetic, or write Java code. You can’t do it the way you wrote in your post.
Regards,
Geoff
Subject: RE: substitution within substitution?
Replied by: Kristian Martell on 23-07-2012 11:07:55 AM
I think I was a bit unclear with my example, the end result is to create a loop that will play via SayItSmat the values in the a series of variables. The data is in variable amount1, amount2 amount3 and so forth. I have no way of knowing how many I will get back until the dip itself happens. So what i was trying to do was tell SayItSmart to play whatever was in the Session Variable named "amount" and the value of a counter. so essentially concatenating the name of the session data variable.
Something tells me I will be writing Java to move my desired data to a static variable name such as plain "amount" and having SayItSmart always look there, but none the less I figured i would see if anyone else had any other creative ways of creating a dynamic Variable name.
Subject: RE: New Message from Asher Schweigart in Customer Voice Portal (CVP) - Gene
Replied by: GEOFFREY THOMPSON on 23-07-2012 11:30:45 AM
>>>You can’t concatenate variable names in Call Studio
You can do that.
Regards,
Geoff
Subject: RE: substitution within substitution?
Replied by: Kristian Martell on 23-07-2012 11:54:07 AM
thanks guys, yea I think I will just do it in java. I was trying to find away around it but no biggie. We are doing all of the REST get and parsing in java already, so whats one more class gonna hurt right? Oh well,thanks again for the input.
Subject: RE: New Message from Kristian Martell in Customer Voice Portal (CVP) - Gene
Replied by: GEOFFREY THOMPSON on 23-07-2012 11:14:45 AM
>>>Something tells me I will be writing Java to move my desired data to a static variable name such as plain "amount" and having SayItSmart always look there
That’s what I do. As soon as you step outside the basic capabilities of CVP you must go to Java. I’ve written many CVP applications over the last 8 years and only 1 had no Java in it.
Regards,
Geoff
Subject: RE: New Message from GEOFFREY THOMPSON in Customer Voice Portal (CVP) - Gen
Replied by: Asher Schweigart on 23-07-2012 11:21:45 AM
You can’t concatenate variable names in Call Studio, you’d definitely have to use java for that, although I’m not sure if you could do what you are trying to do there either.
If you have the ability to modify the REST application, you could try to have it return a single variable with all the values concatenated into a CSV. You’d still have to use some java, but you would just have to parse a csv, and I imagine that would be easier and cleaner to deal with in java.