Logic Apps (Standard) Data Mapper: What is a function?

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

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

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

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

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

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! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to Top