Power Automate > Using conditional logic in Power Automate
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.
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.
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:
- Click inside the value box when configuring a condition (or any field that accepts expressions).
- The dynamic content pane appears. Switch to the Expression tab.
- Type or select functions to build your expression.
Common expression functions for Tallyfy data:
- String functions:
concat('string1', 'string2')- joins stringssubstring('text', startIndex, length)- extracts part of a stringtoLower('TEXT')/toUpper('text')- converts case (handy for case-insensitive comparisons of Tallyfy form field values)contains('text', 'searchText')- checks if text includes a substringstartsWith('text', 'searchText')/endsWith('text', 'searchText')
- Date/time functions:
utcNow()- current UTC date and timeaddDays(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 stringfloat('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 emptyequals(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')
The basic conditions article covers adding multiple rows to a Condition control. Grouping takes this further by letting you nest logic.
- Add multiple rows: Click + Add > Add row within your condition.
- Select rows: Check the boxes next to the condition rows you want to group.
- 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)
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:
- Add a Switch control.
- On: Set the value to evaluate (e.g., a Tallyfy form field via dynamic content).
- Case: Add a Case branch for each possible value. Enter the matching value in the Equals field.
- Place the actions for that case inside its branch.
- Default: Runs if none of the Case values match.
This diagram shows how the Switch control provides clean, single-evaluation branching instead of complex nested if-then conditions.
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.
- CASE
- 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)
- Condition:
- 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.
- 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(), orformatDateTime(). 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.
Automations > Logic operations explained
Conditionals > Conditionals (IF) explained
Was this helpful?
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks