Use Azure Logic Apps Function expressions
  • Updated on 22 Mar 2019
  • 1 minute to read
  • Contributors
  • Print
  • Comments
  • Share
  • Dark
    Light

Use Azure Logic Apps Function expressions

  • Print
  • Comments
  • Share
  • Dark
    Light

#ServerlessTips - Azure Logic Apps
Author: Steef-Jan Wiggers Azure MVP

During the execution of your Logic Apps, some values can be set by functions provided by the Workflow Definition Language. You can define these functions when creating your workflow definition actions. For instance, you can combine two strings to one using concat string function.

The functions or expression type of capability in Logic Apps actions can be handy to enhance your Logic App.

Moreover, the functions allow you to do all kinds of expressions such as:
• String functions
• Collection functions
• Logical comparison functions
• Conversion functions
• Math functions
• Date and time functions
• Workflow functions
• URI parsing functions
• Manipulation functions: JSON & XML

You perform these functions on an item or property of a json document or perform another function on the result of a previous function (nesting).

LogicAppsFunctionsExpression.png

The function expression above is:

div(body('Get_route_and_travel_time_with_traffic')?['travelDuration'],60)

The body function (workflow function) provides the value from the previous action calculating the travel time and the div function (math function) needs that value, and the value 60 to get the travel time in minutes. Hence, this is an example of the capability the functions in Logic Apps offer.

In case you need to do a lookup or a more complex computation then you call an Azure Function or API from a Logic App

Watch this episode from Middleware Friday series:

Was this article helpful?