Logic Apps (Standard) Data Mapper supports complex structural transformations from records and fields (elements or attributes) in the source schema to records and fields in the destination schema. Functions perform calculations by using predefined formulas and specific values called arguments (or inputs). These calculations are executed based on the designated order of the records and fields.
We can add a function to the mapping area by selecting a Function from the Function panel. Then we need to link it to nodes in the source schema and destination schema. This will allow us to modify (transform) the data from the source to the destination message. For example, data can be concatenated, DateTime information can be added, or other operations can be performed. If we take the following function samples:
- The Add function adds values (Returns the sum from adding two or more numbers).
- The Concat function combines two or more strings and returns the combined string.
- And the Count function returns the count of items in a collection.
Note: All functions are based on XPath 3.0. (at least till the time I’m writing this blog post)
Data Mapper functions are divided into categories according to their intended use. For example, string functions are designed to perform a variety of string functions, such as trimming and concatenation. Mathematical functions are used to perform mathematical operations, and so on. In Data Mapper, functions appear on demand by category in the Function panel.
Functions Categories and description
The following table shows the functions categories, briefly describes the category, and shows the list of functions in each category, including links to their corresponding reference pages.
Function category Category description | Functions in category |
Collection Used to perform a variety of operations over collections, such as cumulative sum, short, or get distinct values. | Average, Count, Direct Access, Distinct Values, Filter, Index, Join, Maximum, Minimum, Reverse, Sort, Sub Sequence, Sum |
Conversion Used to convert values to specific times. | To DateTime, To integer, To number, To string |
Date and Time Used to perform a variety of operations over Dates, such as retrieving the current date and time or adding dates. | Add days, Add DayTime to Date, Add DayTime to DateTime, Add DayTime to Time, Add YearMonth to DateTime, Adjust Date, Adjust DateTime, Adjust Time, Current date. Current DateTime value, Current time, DateTime, Day from DAte, Day from DateTime, Equal Date, Equal DateTime, Equal Day, Equal Month, Equal MonthDay, Equal Time, Equal Year, Equal YearMonth, Greater Date, Greater DateTime, Greater Time, Hours from DateTime, Hours from Time, Less Date, Less DateTime, Less Time, Minutes from DateTime, Minutes from Time, Month from Date, Month from DateTime, Seconds from DateTime, Seconds from Time, Subtract Dates, Subtract DateTimes, Subtract DateTime from Date, Subtract DateTime from DateTime, Subtract DateTime from Time, Subtract Times, Subtract YearMonth from Date, Subtract YearMonth from DateTime, Time zone from Date, Time zone from DateTime, Time zone from Time, Year from Date, Year from DateTime. |
Logical comparison Used to perform a variety of logical operations, such as greater than and logical existence. | Equal, Exists, Greater, Greater or equal, if, if else, Is date, Is DateTime, Is nil, Is null, Is number, Is string, Less, Less or equal, Logical AND, Logical NOT, Logical OR, Not equal |
Mathematical Used to perform a variety of mathematical and scientific operations, such as addition and multiplication. | Absolute, Add, Arctangent, Ceiling, Cosine, Divide, Exponential , Exponential (base 10), Floor, Integre divide, Log, Log (base 10), Modulo, Multiply, Power, Round, Sine, Square root, Subtract, Tangent |
String Used to perform a variety of string functions, such as trimming and concatenation. | Codepoints to string, Concat, Contains, Ends with, Length, Lowercase, Name, Regular expression matches, Regular expression replace, Replace, Start with, String to codepoints, Substring, Substring after, Substring before, Trim, Trim left, Trim right, Uppercase |
Utility Used to perform a variety of additional and distinct operations that don’t fit in the above Categories, such as stopping a transformation and returning the specified error code and description or format a number or a date. | Copy, Error, Format date, Format DateTime value, Format number, Format time |
Note: The purpose of a function is usually obvious from its name.
Hope you find this helpful! So, if you liked the content or found it useful and want to help me write more, you can buy (or help buy) my son a Star Wars Lego!