Skip to content


Syntax to combine results from two columns into a new calculated third column

Robert asked 3 months ago

Hello, I am trying to find a way to import shipping addresses into Salesforce from D365.  Problem is that Salesforce only uses one Shipping Street address field and D365 contains the data from two fields ‘Address’ and ‘Address 2;   In EONE Smartconnect Integration I have tried to add a third calculated column that I called “combinedshipping” to merge the results.  Has anyone done this so the results from Address and Address2 can both come over (being mapped) via a custom column? Lastly, I would like to have the  Address and Address2 results separated with a line break if possible so in Salesforce the ‘Address 2’ data would show below ‘Address’ data.  

For instance in salesforce it may look like this:

12 Main Street  (this is Address)
Suite 34 (This is from Address 2)

Below is my new column entry but have no clue on how to combine the data with a line break.

return ‘this._Address,this._Address_2’;


Any examples would truly be appreciated


Robert replied 3 months ago

Just to update the following example does combine the two columns into a new third one but still does not provide a line break between the data. If anyone knows that syntax to add please share.

return this._Address + “” + this._Address_2; (in Smartconnect I tried using “&” but only using “+” seems to work in the statement shown)

Robert replied 3 months ago

SOLVED: I figured it out. To add a line break the correct syntax to import this to Salesforce turned out to be:
return this._Address + “\r” + this._Address_2;

Adding the \r in the quotes took care of it. Hope this helps someone else.

If you would like to submit an answer or comment, please sign in to the eOne portal.