Strings are a sequence of characters and are one of the most common data types used in the integration. Almost 90% of the data which comes from one application to another are serialized as strings, and hence the transformation requires certain modifications on strings to process it. In this article, we will look into how to effectively use strings in APPSeCONNECT just like other data types, such that you can easily transform string data from one application to another.
Do you have multiple systems running? Connect all your business applications under one single platform to automate the business process and increase your productivity and efficiency!
Steps to Define a String Field
Just like any other attribute, almost 90% of the data that is getting transferred through the platform are strings. As in APPSeCONNECT, we provide a number of data types that you can select for each attribute. To define the String field in a schema, we need to first create an attribute on that particular schema. To do such a thing, please follow the steps mentioned below :
1. Open portal.appseconnect.com
2. Go to App Section and click on the Schema of a particular Application.
3. You can add a new Schema from there, which will allow you to define a schema for a particular endpoint
4. You can add as many fields as you want, each attribute will have its type. (String for instance).
Once the string field is mentioned on a particular schema, you can use it to store strings during transformation. You can read the documentation to know more on how to add or import schema in APPSeCONNECT.
The transformation is a process in APPSeCONNECT which lets you pick fields from the source application schema and put it into the target schema such that the data which is actually getting transferred through the process creates a completely new structure from the source structure. This is the core component of the platform, which allows you to create a document that is consumable to the target application. Sometimes there is a need of converting the data type of the target schema, in APPSeCONNECT we implicitly do such a conversion, also giving you the flexibility to deal with the formatting of data. Now while defining transformation, you might need some tooling that you want to execute on a string field to get proper results. Let us discuss how to do such a thing using the APPSeCONNECT transformation engine.
Some common methods to transform String field:
|String Join||concat(string1, string2)||Joins two strings together|
|Get a small string from a large one||substring(string, startindex, len)/
|Returns the substring from the start position to the specified length.|
|Get String length||string-length(string)||Returns the length of the specified string.|
|Remove redundant characters||normalize-space(string)||Removes leading and trailing spaces from the specified string, and replaces all internal sequences of white space with one and returns the result.|
|Gets substring from a character||substring-before(string1,string2)/
|Returns the string before or after the string passed.|
|Check for a string||contains(string1,string2)/
|Finds a string inside another string and returns a boolean.|
|Get all strings from one||tokenize(string, pattern)||Find all strings inside the master string based on the pattern passed in.|
|Trim characters from a string||[genericlib:TrimSpaceAllSides(data)] /
|The function will allow you to trim unnecessary data. The first function trims only spaces, while the second one does for the characters specified.|
|Use Regular expression to replace data||[genericlib:RegexReplace(data,regex,replaceString)]||Regular expressions is a whole new way to define patterns. This function takes a regular expression and replaces characters from the data.|
|Change case of the data||[genericlib:GetUpperString(data)]/
|Sometimes you want to change the case of the data. For instance, you can change all characters to Upper case or Lower case or even Title case.|
|Replace invalid characters||[genericlib:ReplaceAllCharacters(data,characters,replacechar)]||This function will allow you to replace all the characters passed in the parameter with the one specified.|
|Encode or decode Base64||[genericlib:Base64Encode(dataString)] /
|Base64 is becoming a standard in Web. This function will allow you to encode and decode data based on requirements.|
|Formatting data or Default||[genericlib:GetDataOrDefault(data,defaultText)]
|These functions allow you to provide data, which when do not have data, will replace with a default data.|
|Formatting double or Int Values||[genericlib:GetDoubleFormattedOutput(data,formatspecifier,defaultDate)] / [genericlib:GetIntFormattedOutput(data,formatspecifier,defaultvalue)]||These functions allow you to specify data formats and change convert or reformat the data passed in.|
|Wrap invalid characters in CData||[genericlib:WrapInCData(data)]||In XML CData allows keeping data intact. In case if you think the data has some invalid characters, this function lets you use them|
|String representation of Base64||[genericlib:GetBase64String(data)] /
|These functions will allow making use of Base64 data as strings.|
Note: Please note the transformation engine always encodes the characters based on the encoding specified by the transformation developer. So if you have a Unicode character, make sure you specify the proper Unicode character specification directly in the transformation template.
APPSeCONNECT is a smart and robust business application integration platform that seamlessly connects all your business applications with each other to streamline operations and facilitate the free flow of data across the platforms. By moving into the region of iPaaS, APPSeCONNECT proves to be a best-in-the-class platform that easily connects systems and automates the business process.
Now, you can easily connect all your business applications under one single platform to automate the business process and increase your productivity and efficiency!