VoiceGuide IVR Software Main Page
Jump to content

Concatenate

Recommended Posts

Hello!

 

My problem is that when I concatenate several rows from a query into a variable and then I want to send this info to somebody via email I can see that the variable contains all the rows but I can also see the operators used to concatenate.

 

In a Evaluation expression module I initialize a variable, namely SMS, that will contain all the rows from a query. In another Evaluation exp. module I want to concatenate every row from the query and even if I´ve tried with both operators "+" and "&" with the following expression, I still can see them in the email.

 

"$RV[sMS]"&"$RV[CASE bank_1_1]"&";"&"$RV[CASE bank_2_1]"&"/"&"$RV[CASE bank_3_1]"&Chr(10)

 

Can you help me?

Jose

Share this post


Link to post

Can you post the entire script?

 

As a start, try changing to this:

 

"$RV[sMS]$RV[CASE bank_1_1];$RV[CASE bank_2_1]/$RV[CASE bank_3_1]" & Chr(10)

Share this post


Link to post

Hello!

 

Still the same problem. When I try with this:

"$RV[sMS]"&"$RV[CASE bank_1_1]"&";"&"$RV[CASE bank_2_1]"&"/"&"$RV[CASE bank_3_1]"&Chr(10)

 

I still can see the & sign and the new line character does not work. Here comes the output:

 

SAS;+4687620460/NULL

VW;+4686951701/NULL & Chr(10)SEB;020775500/+468775500 &

Chr(10)Visa;020793146/+14105819994* & Chr(10)

 

I send you the script. Thank you for your help!

 

Jose

blockdirekt.vgs

Share this post


Link to post

I see you are using the Evaluate Expression module, not a VBScript module...

Just use this:

 

$RV[sMS]$RV[CASE bank_1_1];$RV[CASE bank_2_1]/$RV[CASE bank_3_1]

 

Try using another Evaluate Expression module to assign linefeed to another variable, and then you can use that RV as part of expression. ie. assign this expression:

 

Chr(10)

 

to an RV - say $RV[LF] - and then you can use

 

$RV[sMS]$RV[CASE bank_1_1];$RV[CASE bank_2_1]/$RV[CASE bank_3_1]$RV[LF]

 

But you may just want to look at using VBScript for creating this string.

Share this post


Link to post

Hello!

 

I think I was not clear enough. What I need is to have a variable, called SMS, that will contain between 3 or 4 rows from a query to a DB and I need to have a linefeed after each row. For example:

 

Since the variable SMS is empty from the beginning the first row is ok and the linefeed works fine there, but when I try to concatenate the second row then things happen like the linefeed does not work any more and I get the + operator everywhere.

 

I have declared Chr(10) in a own variable and I do as you suggested but still have problems.

 

$RV[sMS]$RV[CASE bank_1_1];$RV[CASE bank_2_1]/$RV[CASE bank_3_1]$RV[LF]

 

 

Thank you for your help,time!

Jose

Share this post


Link to post

If you want to concatenate multiple returned fields from multiple returned rows then its easier to just use VBScript to do this.

 

There is a recent thread on this very similar topic:

http://voiceguide.com/forums/index.php?showtopic=3083

 

 

Basically in your case you want to do something like this in a VSCript module:

set vg = CreateObject("VoiceGuide.CommandLink")
for i = 1 to $RV[CASE bank_RowCount]
 s1 ="RV[CASE bank_1_" & i & "]"
 s2 = "RV[CASE bank_2_" & i & "]"
 s3 = "RV[CASE bank_3_" & i & "]"
 sReturnValue = sReturnValue & vg.RvGet($RV_LINEID, s1) & ";" & vg.RvGet($RV_LINEID, s2) & "/" & vg.RvGet($RV_LINEID, s3) & vbCrLf
next
vg.Run_ResultReturn $RV_LINEID, "[SMS]{"& sReturnValue &"}"
set vg = Nothing

 

Then $RV[sMS] should then contain all the data formatted with a CRLF between each row.

 

Please modify your script appropriately and if you still have problems please post the script and the trace capturing the call.

Share this post


Link to post

Hello!

 

Thnak you! Now it is working as it should but I have another problem: Inside a VBS module I need to know the length of two variables that I created in an Evalutate exp. module.

 

I cannot find anything any help and I am trying whithout any luck. I have this:

 

set vg = CreateObject("VoiceGuide.CommandLink")

sms="RV[sMS]"

 

if len(sms) > 70 then

vg.Run_ResultReturn $RV_LINEID, "success"

....

but no matter the length of the variable I know get "success". I have also tried

with:

if len("$RV[sMS]") > 70 then

vg.Run_ResultReturn $RV_LINEID, "success"

....

and

if len($RV[sMS]) > 70 then

vg.Run_ResultReturn $RV_LINEID, "success"

....

but without any luck.

 

Thank you!

Jose

Share this post


Link to post

When running the module, in VoiceGuide's trace log you will see a reference to a .VBS file that VG creates with all of the RVs replaced with their values - please post the file that the trace log entry refers to.

 

File will be called something like this: vbs_X_Y.vbs and is located in VG's \data\ subdirectory.

 

The log entry will look something like this:

 

085823.69 10 vbs ran [vbs_10_1.vbs], cmd [wscript "c:\Program Files\VoiceGuide\data\vbs_10_1.vbs" //I //T:10]

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×