Ask a Question

Make it possible to concatenate the values of two variables into the third one

0 Kudos

Make it possible to concatenate the values of two variables into the third one

I would like to ask for the possibility to concatenate the values of two variables into the third one. This can be implemented in the same tables where data are extracted from the responses and assigned to the variables (Data Selectors, etc.).

In this case, the value of the 'Source' field (using Data Selector table as an example) may be 'Variables', 'Regular Expression' will specify the name of the first variable (e.g. @Var1), 'Subexpression' will specify the name of the second variable (e.g. @Var2) and the 'Save to Variable' field will specify the name of the variable that contains concatenation result (e.g. Var3).

It would be perfect, if it is possible for Var1 and Var2 specify not only variable name, but some string that contains (or not) the variable - e.g.: if Var1 = 'CaseId' and Var2 = '123', then '@Var1' and '=@Var2' should concatenate to 'CaseId=123'.

 

Please let me know if you need more details for this request.

9 Comments
TanyaYatskovska
SmartBear Alumni (Retired)
Status changed to: New Idea
 
RyanHeidorn
Staff

Hi Alex,

 

This is already possible within LoadComplete. From the documentation on variable creation (see full article here😞

 

  • To concatenate the values of several variables:

    Regular Expression Subexpression Save to Variable Decode
    @Var1@Var2@Var3 $1 ConcatVar Do not decode

    The values of the Var1, Var2 and Var3 variables will be concatenated and saved to ConcatVar. For example, if Var1 = 12, Var2 = oct and Var3 = 13, the ConcatVar variable will contain "12oct13". If you specify Upper case in the Decode cell, the result will be "12OCT13".

 

Hope this helps.

TanyaYatskovska
SmartBear Alumni (Retired)
Status changed to: Implemented
 
AlexKaras
Champion Level 2

Great, thank you, Ryan!

omohammad27738
Visitor

Hi all Sorry for restarting an old post however I think its directly related to the question asked.

 

I'm saving 3 variables from a response using the "Parameter" tab and then trying to the "Data Selectors" as described above to concatenate these values however it is failing for me

 

I actually need these variables (concatenated into one) to use in the the Request Header for Request 010 later down the line

 

Does someone know this would be failing?

 

 

Many thanks in advance

 

Omarshot1.pngshot2.png

RyanHeidorn
Staff

Hi Omar,

 

I'm not sure, but I think this could be a timing issue. Since you're trying to do it all within the same request, it's possible that LoadComplete is trying to process the variable concatenation before it actually saves those parameters to their respective variables.

 

I suggest doing the variable concatenation in a data selector for a subsequent request (i.e. requests 5-9), and then try using that concatenated variable where you need it in request 10.

 

 

omohammad27738
Visitor

Hi RyanHeidorn

That worked a treat - thank you! Smiley Happy

pprajapati
Occasional Visitor

I am in situation where I need to randomize email addresses in request. 

 

Steps Taken:

 

1. Created spreadsheet with all email addresses

2. Created variable and used it in request

 

But doing this is failing email address verification as Loadcomplete is converting 'a1@ot.com' to 'a1%40ot.com'.

 

Need help to make this possible to keep '@' as '@' only.

AlexKaras
Champion Level 2

@pprajapati:

Can you post a screenshot of how the variable with e-mail address is composed?

Announcements
Welcome to the LoadComplete Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Welcome to the Community
Sign Up Here
Labels