powerautomate

Expressions Demo

When you build a flow in Power Automate, it’s easy to get started by adding a trigger and actions and then passing data between them with dynamic content. But, in most cases you need to perform more complex operations. You may want to do a calculation, to transform data for your solution, or access, convert, and compare values. To do these things, you can look to expressions.

In Power Automate, expressions are a set of simple functions that enable you to return data. Put simpler, you use expressions to write a formula to get your data the way you want it. Expressions allow you to do things like convert a date to UTC, divide two numbers, create that perfect string by combining fields, and much more all by using various functions.

Flows in Power Automate run on top of Azure Logic Apps. This is relevant because they both use all of the same functions. When you’re searching the internet for solutions or reading documentation about Power Automate functions, it’s common to end up looking at Logic Apps documentation. For example, the Reference Guide of functions for Power Automate is hosted on the Logic Apps side of the documentation.

Through the rest of this module, you’ll learn about the different types of functions and the syntax so you can start to use expressions in your flows.

In this Lab

Task 1

a. Import the flow solution available in the resources section of this lab. Navigate to My Flows > Import > Import Package (Legacy)

image

b. Configure the flow in the import setup. Click on Action > Select Create as new under the Setup dropdown.

image

Notice in the imported flow that we used a Manual trigger. This allows you to have a simple setup for writing and testing your expressions without worrying about other inputs or actions.

c. Initialize the first name and last name by setting the value field in the First Name and Last Name variables

image

d. Write the expression to concatinate the first and last name in the Full Name variable.

image

e. Add a new action to create an email calendar event.

image

f. Initialize the variable Last Split using the below expression: Expression: last(split(variables(‘Full Name’), ‘ ‘))

image

g. Save and Test the flow Manually.

image

Please ensure you sign in to the email connector before running the flow.