Skip to content

Advanced conditions and expressions in Power Automate

Basic if-then logic works for simple Tallyfy processes in Power Automate. But real workflows get messy fast - they need multiple conditions, calculations, and edge case handling. This article covers three techniques for smarter decision-making with Tallyfy data: expressions, grouped conditions, and the Switch control.

Conditional logic refresher

The Condition control - covered in using conditional logic in Power Automate - checks whether something’s true or false and routes your flow accordingly. The techniques below extend those basics to handle more complex Tallyfy data scenarios.

Working with expressions in conditions

Expressions are formulas that manipulate Tallyfy data, run calculations, and pull specific properties from dynamic content. Pair them with conditions and you can handle the real-world edge cases in your business processes.

To use an expression:

  1. Click inside the value box when configuring a condition (or any field that accepts expressions).
  2. The dynamic content pane appears. Switch to the Expression tab.
  3. Type or select functions to build your expression.

Common expression functions for Tallyfy data:

  • String functions:
    • concat('string1', 'string2') - joins strings
    • substring('text', startIndex, length) - extracts part of a string
    • toLower('TEXT') / toUpper('text') - converts case (handy for case-insensitive comparisons of Tallyfy form field values)
    • contains('text', 'searchText') - checks if text includes a substring
    • startsWith('text', 'searchText') / endsWith('text', 'searchText')
  • Date/time functions:
    • utcNow() - current UTC date and time
    • addDays(timestamp, days, 'format') - adds days to a date (e.g., calculating a new deadline from a Tallyfy task’s start date)
    • formatDateTime(timestamp, 'formatString') - formats a date/time (e.g., 'yyyy-MM-dd')
  • Conversion functions:
    • int('stringValue') - string to integer (useful when a Tallyfy form field stores a number as text)
    • string(value) - value to string
    • float('stringValue') - string to floating-point number
  • Logical functions:
    • if(condition, valueIfTrue, valueIfFalse)
    • and(condition1, condition2) / or(condition1, condition2) / not(condition)
    • empty(value) - checks if a string, array, or object is empty
    • equals(value1, value2) - checks for equality

Tallyfy example - checking if a task is overdue:

Suppose a Tallyfy task stores its due date in a text form field called TaskDueDateText:

  • Value 1 (Expression): formatDateTime(outputs('Get_task_details')?['body/forms/TaskDueDateText/value'], 'yyyy-MM-dd')
    • This assumes a consistent date format. If formats vary, you’ll need additional parsing.
  • Operator: is less than
  • Value 2 (Expression): formatDateTime(utcNow(), 'yyyy-MM-dd')

Grouping conditions (AND/OR logic)

The basic conditions article covers adding multiple rows to a Condition control. Grouping takes this further by letting you nest logic.

  1. Add multiple rows: Click + Add > Add row within your condition.
  2. Select rows: Check the boxes next to the condition rows you want to group.
  3. Make group: Click the ellipsis (…) on a selected row and choose Make group.

Each group gets its own AND/OR operator, and you set a separate AND/OR for how that group relates to other conditions at the same level. This works like parentheses in logic - great for “if this AND that, OR if something else entirely” scenarios with Tallyfy processes.

Tallyfy example: Escalate a process IF: (Process Name CONTAINS “Urgent” AND Priority form field IS “High”) OR (Days Overdue (calculated via expression) IS GREATER THAN 3)

Using the Switch control for multiple outcomes

When you’re checking one Tallyfy form field value against many possible matches, nested conditions get unwieldy fast. The Switch control is cleaner, easier to read, and simpler to maintain.

  • Structure:
    1. Add a Switch control.
    2. On: Set the value to evaluate (e.g., a Tallyfy form field via dynamic content).
    3. Case: Add a Case branch for each possible value. Enter the matching value in the Equals field.
    4. Place the actions for that case inside its branch.
    5. Default: Runs if none of the Case values match.

How Switch control eliminates nested conditions

This diagram shows how the Switch control provides clean, single-evaluation branching instead of complex nested if-then conditions.

Diagram

What to notice:

  • Single evaluation point - The Switch evaluates the Request Type field once, not repeatedly like nested conditions would
  • No nesting required - Each case branches directly from the central evaluation, keeping your flow clean and readable
  • Default fallback - Unknown or unexpected values automatically route to a default action, preventing flows from breaking

Tallyfy example: A task has a form field called “Request Type” with values “Information,” “Access,” and “Hardware.”

  • SWITCH ON: outputs('Get_task_details')?['body/forms/RequestType/value']
    • CASE Information: Send an email with knowledge base links.
    • CASE Access: Create an approval request, possibly using Power Automate approvals with Teams.
    • CASE Hardware: Launch a Tallyfy “Hardware Procurement” template.
    • DEFAULT: Notify IT support about an unclassified request.

Advanced conditional patterns

  • Checking for null or empty values: Always check if optional Tallyfy form fields are empty before using them - otherwise your flow crashes when the value doesn’t exist. Use empty():
    • Condition: empty(outputs('Get_task_details')?['body/forms/OptionalComment/value'])
    • Operator: is equal to
    • Value: true (expression)
  • Error handling: Use “Configure run after” settings on actions within conditional branches to handle failures. If a step fails, you can retry, skip, or take an alternative path. More details in managing and monitoring Power Automate flows.

Best practices for advanced conditions with Tallyfy

  • Readability: Use a “Compose” action (see working with data operations and variables) to build and test complex expressions before plugging them into conditions. Power Automate doesn’t support inline comments, so document complex logic externally.
  • Modularity: If you’re drowning in nested conditions, break the flow into smaller child flows. It adds management overhead but keeps things maintainable.
  • Data type awareness: Tallyfy form fields often store values as text. Convert before comparing - use int(), float(), or formatDateTime(). Comparing “10” to 2 as strings produces wrong results.
  • Testing: Test every path through your conditions and switches with different Tallyfy data - valid inputs, edge cases, and empty values. Catch issues before production.

Power Automate > Using conditional logic in Power Automate

Power Automate’s conditional logic lets flows make decisions based on Tallyfy data - using IF-THEN structures, Switch controls, and nested conditions to route actions differently based on task statuses, form field values, and process conditions.

Automations > Logic operations explained

Tallyfy automations use simple IF-THEN rules instead of complex flowcharts to watch user inputs and automatically adjust workflows by showing or hiding steps and reassigning tasks and changing deadlines based on conditions that can be combined with AND/OR logic and evaluated left to right in the order you add them.

Automations > Conditionals

Tallyfy’s conditional logic lets workflows make automatic decisions using simple “IF X happens” rules based on form field answers and step statuses so processes adapt in real time without manual intervention or complex flowcharts.