The Scribe technical team has been working to compile a useful list of technical tips and tricks to help users get the most out of the system. We'll be offering these to you as blog posts and tutorial videos posted online. For this one, we'll be talking about formatting data and using escape characters within formulas.
During the mapping of data between different endpoints, there may be some formatting transformation that needs to occur; the example we're going to use here is writing address data to Salesforce.com. Salesforce addresses are basically 3 rows of data separated by carriage return/line feeds, all stored within 1 text field. In order to mimic this formatting we must concatenate several fields together along with escape characters to allow the carriage return/line feed to be added between our 3 concatenated fields.
We are able to accomplish this with SYS as these escape characters are able to be used within a formula, but, there is a caveat. You must first declare that you are going to be using these characters in the next segment of text. This is done by using the $ character prior to the text string with the escape characters. To explain what this means, we'll use a real example. We have three Address fields in our source data, Line1, Line2, and Line 3. They contain the following data
If we were to simply concatenate these fields together as seen in the formula below
our resulting value would look like this:
Obviously we can do better than this. Instead of simply concatenating them together, we'll use our escape characters. The formula seen below is designed to use these escape characters and will allow our data to be written to Salesforce.com with the proper formatting.
Here you can see the result of our formula, where our data is represented with the proper syntax and formatting.
By concatenating our escape characters \r and \n we were able to put a carriage return/line feeds between each field, resulting in the formatting we needed to bring that address properly into Salesforce. To illustrate the importance of declaring these special characters, I have removed the $ from the formula we used before
The resulting data in Saleforce.com would appear as it is seen here
So you can see that without our $ declaration, it's interpreted as plain text. There are many escape characters that can be used to assist you within formulas, we have outlined some in our online help, and you can also simply look these up online to get some definition around what is and is not possible.
Hopefully this will help you as you begin to use the Scribe Online Synchronization Service. Keep an eye out for more tips and tricks coming from our technical team here at Scribe Let us know if you have any comments about things you would like to see explained.
