Concatenate two or more fields through transform map

sajal_chatterje
Tera Contributor

Hello Community,

 

There is need to concatenate 4 fields from excel sheet into field "description" while doing the transform map. How can I achieve it through script.

 

Where Am I supposed to write the script?

The fields are 

ISSUE_TYPE_NAME
REPORTER
LAST_EDITED_DATE
CREATED_DATE

 

2)Also, they have this field created date in excel sheet and they are looking to map it in RITM created date field. Question: - Is it possible to map created date into RITM create date?? My understanding is it is going to map system dates i.e the date at which the tickets are created not any other dates?

 

Thanks!

 

2 REPLIES 2

AshishKM
Kilo Patron
Kilo Patron

Hi @sajal_chatterje , 

In the transform mapping, check the Use source script and read all 4 variables, concatenate them and set to target field. Write some draft code and share if it didnt work for you.

 

AshishKMishra_0-1715346732762.png

 

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @sajal_chatterje 

 

 

var field1 = source.field1.toString();
var field2 = source.field1.toString();
var field3 = source.field1.toString();
var field3 = source.field1.toString();
var concatFiled = field1 + ' ' + field2 + ' ' +  field3 + ' ' +  field4;
target.short_description = concatFiled ;

 

 

 


    var description = source.issue_type_name + " - Reported by: " + source.reporter + "\nLast Edited Date: " + source.last_edited_date + "\nCreated Date: " + source.created_date;
  
    target.description = description;


 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect