Reader small image

You're reading from  Workflow Automation with Microsoft Power Automate - Second Edition

Product typeBook
Published inAug 2022
PublisherPackt
ISBN-139781803237671
Edition2nd Edition
Right arrow
Author (1)
Aaron Guilmette
Aaron Guilmette
author image
Aaron Guilmette

Aaron Guilmette is a Senior Program Manager with the Microsoft 365 Customer Experience, helping customers adopt and deploy the Microsoft 365 platform. He primarily focuses on collaborative technologies, including Microsoft Teams, Exchange Online, and Azure Active Directory.
Read more about Aaron Guilmette

Right arrow

Working with Conditions

In Chapter 6, Generating Push Notifications, we introduced the concept of conditions. Conditions can be used to evaluate parameters and data inside a flow to inform a decision. Conditions are an important part of building more complex flows.

Conditions can also be used to impose limits on the number of runs or actions that a particular flow takes – for example, making sure a certain threshold is met before committing processing resources.

In previous pricing structures of Power Automate, users were limited in the maximum number of flows they could execute per month with various plans. While the current pricing structure doesn’t specifically limit the number of flow runs per month, there are still some restrictions on concurrency and long-running transactions. In addition, Azure Logic Apps, an enterprise solution using much of the same technology as Power Automate, is billed on a per-connector and per-action basis, so using conditions...

Understanding condition operators

Operators indicate the types of calculations used when evaluating components. You might be familiar with common mathematical operators such as the following:

  • + (addition)
  • - (subtraction)
  • ÷ (division)
  • × (multiplication)
  • < (less than)
  • > (greater than)

These operators are primarily used for evaluating numeric values. When manipulating objects and text in a flow, using mathematical operators may not be sufficient. While you can use numeric expressions in some places, it’s also important to understand other operators that can be used to determine whether a value meets a certain condition.

Power Automate conditions can perform the evaluation of conditions using the following operators:

  • contains
  • does not contain
  • is equal to
  • is not equal to
  • is greater than
  • is greater than or equal to
  • is less than
  • is less than or equal to
  • ...

Using expressions and multiple conditions

Perhaps evaluating conditions based on a single static value (such as the sender of an email message) doesn’t provide the granularity, flexibility, or portability that a flow requires. In that case, you can also use multiple dynamic content values in a condition.

You’ve already seen examples using expressions as part of dynamic content, such as using formatDateTime() and utcNow() in Chapter 4, Copying Files. In that example, expressions were used to help generate the value for the folder name to store an expense report. You can also use expressions or functions as part of a condition.

Conditions that perform more than one evaluation are commonly referred to as advanced conditions. As you will see in the following instructions, you can simply use the Add button and continue adding criteria. When adding multiple criteria to evaluate, there are two operators available: AND and OR. Selecting AND will require all conditions...

Summary

In this chapter, you learned how to work with advanced conditions. Advanced conditions allow you to use multiple dynamic content tokens and expressions in order to restrict what data entities are processed by a flow. Using the AND and OR operators, you were able to combine multiple conditions into groups to create a complex decision process for the flow.

You were also introduced to switch conditions – a type of control action that allows your conditional logic to take different paths depending on a broader set of evaluations.

Conditional processing is important because it can be used to help refine and filter data inputs as well as ensure that business criteria or requirements are met prior to flow execution. Conditional processing also gives you an opportunity to create flows that meet complex business criteria.

In the next chapter, we’ll begin working with approval workflows. Approval workflows are one of the most popular types of flows for organizations...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Workflow Automation with Microsoft Power Automate - Second Edition
Published in: Aug 2022Publisher: PacktISBN-13: 9781803237671
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Aaron Guilmette

Aaron Guilmette is a Senior Program Manager with the Microsoft 365 Customer Experience, helping customers adopt and deploy the Microsoft 365 platform. He primarily focuses on collaborative technologies, including Microsoft Teams, Exchange Online, and Azure Active Directory.
Read more about Aaron Guilmette