Back to blog
Understanding Power Automate Expressions with Practical Examples
Power Automate Understanding Power Automate Expressions with Pr...

Understanding Power Automate Expressions with Practical Examples

Y

Yohannes verified

  • 6 min read
  • 153

Comments: 0

Power Automate is a powerful Microsoft tool that helps you automate repetitive tasks and business processes across applications such as SharePoint, Microsoft Teams, Outlook, OneDrive, and many others. While Power Automate offers many built-in actions, expressions allow you to take your workflows to the next level by adding dynamic calculations, logic, and data manipulation.

In this article, we'll explore what Power Automate expressions are, why they're useful, and some practical examples you can use in your everyday automations.

What Are Power Automate Expressions?

Expressions are formulas written using Power Automate's Workflow Definition Language (WDL). They enable you to perform operations that go beyond standard actions, such as:

  • Formatting text and dates

  • Performing calculations

  • Applying conditional logic

  • Extracting specific values from data

  • Creating dynamic content

Think of expressions as a way to make your flows smarter and more flexible.

Common Use Cases

You can use expressions to:

  • Generate unique document names

  • Calculate future or past dates

  • Convert text to uppercase or lowercase

  • Validate data before updating SharePoint items

  • Extract information from strings and arrays

Let's look at some examples.


1. Convert Text to Uppercase

You may want to standardize data before saving it to a SharePoint list.

Example

Convert a customer name to uppercase.

toUpper(
    triggerOutputs()?['body/CustomerName']
)

Result

If the customer name is:

john smith

The output becomes:

JOHN SMITH

2. Create a Dynamic Folder Name

When creating folders in SharePoint, you may want to include the current year and month.

Example

concat(
    'Projects-',
    formatDateTime(
        utcNow(),
        'yyyy-MM'
    )
)

Result

Projects-2026-06

This is useful for automatically organizing documents into monthly folders.


3. Find the Length of a String

You may need to validate the number of characters entered by a user.

Example

length(
    triggerOutputs()?['body/Comments']
)

Result

If the comments field contains:

Power Automate

The result will be:

14

4. Remove Extra Spaces from User Input

Users often enter unnecessary spaces in forms.

Example

trim(
    triggerOutputs()?['body/Department']
)

Result

Input:

   Finance

Output:

Finance

This helps keep SharePoint data clean and consistent.


5. Check Whether a File Name Contains a Specific Word

You may only want to process files that contain a certain keyword.

Example

contains(
    triggerOutputs()?['body/{FilenameWithExtension}'],
    'Report'
)

Result

If the file name is:

Monthly Report.pdf

The expression returns:

true

6. Calculate a Date 30 Days in the Future

Useful for setting review dates, renewal dates, or reminders.

Example

addDays(
    utcNow(),
    30,
    'yyyy-MM-dd'
)

Result

If today is:

2026-06-15

The output becomes:

2026-07-15

7. Get the Current Year

You may want to use the current year when generating reports or file names.

Example

formatDateTime(
    utcNow(),
    'yyyy'
)

Result

2026

8. Replace Text Within a String

Replace outdated department names or abbreviations.

Example

replace(
    triggerOutputs()?['body/Department'],
    'HR',
    'Human Resources'
)

Result

Input:

HR

Output:

Human Resources

Conclusion

Power Automate expressions are one of the most valuable tools for building intelligent and dynamic workflows. Whether you're working with SharePoint lists, document libraries, emails, or approvals, expressions allow you to manipulate data, perform calculations, and automate complex business logic with ease.

As you become more comfortable using expressions, you'll discover that many tasks that once required multiple actions can be completed with a single expression, making your flows more efficient, maintainable, and powerful.

Collaborative publishing

Build on this work

The author has not enabled new contributions for this item.

Discussion (0 comments)

Join the Discussion

Login to share rich-text comments and reply to other members.

No comments yet. Be the first to share your thoughts!