The CreatorCon Call for Content is officially open! Get started here.

How to concatenate 2 source fields into 1 target field on a transform map

Charles Hong
Mega Expert

Hello - i have a transform map importing in data from an excel sheet and i want to take 2 fields from the spreadsheet and concatenate them into one field onto the importing table.I have tried multiple scripts but can't seem to work. Could someone please give me some input on my script below? 

 

find_real_file.png

1 ACCEPTED SOLUTION

you can add another space between two string.

 

here we go. 

 

var op = abc+' '+abc1;

View solution in original post

7 REPLIES 7

Harsh Vardhan
Giga Patron

answer is already  a  reserved variable so you don't need to declare it .

 

answer = (function transformEntry(source) {

// Add your code here

var abc =source.fieldA;

var abc1 = source.fieldB

var op = abc+abc1;
return abc; // return the value to be put into the target field

})(source);

Thank you. 

Last question - when i have "var op = abc+abc1;" there are no spaces in between. How can i do it so there is a space between the 2 values? 

Charles Hong
Mega Expert

Last question - when i have "var op = abc+abc1;" there are no spaces in between. How can i do it so there is a space between the 2 values?