Power Automate > Using conditional logic in Power Automate
Working with data operations and variables in Power Automate
Your Power Automate flows need to handle real data - lots of it. When you’re pulling information from Tallyfy, you’ll work with collections of tasks, data from form fields, and everything in between. You need ways to store values temporarily, transform data, and process multiple items at once. That’s where data operations and variables come in.
Think of variables as temporary storage boxes. They hold data while your flow runs, and that data can change as the flow progresses through different steps.
-
Why use variables with Tallyfy integrations?
- Store intermediate results from calculations or data lookups related to Tallyfy items.
- Count Tallyfy tasks meeting certain criteria.
- Accumulate data (like a list of Tallyfy task names) before sending it to Tallyfy or another system.
- Control loop behavior or conditional logic based on a changing value from Tallyfy data.
-
Types of variables: Power Automate supports several data types:
- Boolean: True or false.
- Integer: Whole numbers (e.g., 10, -5).
- Float: Numbers with decimals (e.g., 3.14).
- String: Text.
- Array: A list or collection of items (e.g., a list of Tallyfy task names).
- Object: A complex data structure with key-value pairs (often representing JSON objects).
-
Common variable actions:
- Initialize variable: Always comes first - declares a variable, names it, sets its type and initial value
- Set variable: Updates the value after initialization
- Increment variable / Decrement variable: Adds or subtracts 1 (perfect for counters)
- Append to string variable: Tacks text onto the end of a string
- Append to array variable: Adds items to your list
Got multiple items to process? The Apply to each control handles that.
- How it works: Feed it an array of Tallyfy items. It runs your actions once for every single item.
- Automatic usage: Power Automate’s pretty smart - it’ll add an “Apply to each” loop automatically when you select dynamic content that’s a list (like rows from a Tallyfy table form field)
- Explicit usage: You can also add an “Apply to each” control yourself and point it to array data from an earlier step
Tallyfy example: Let’s say you have a task with a table-type form field where users list equipment needed for a project. When you pull this task’s details through the Tallyfy connector or API, that table comes back as an array. Perfect scenario for looping.
Use “Apply to each” to go through every row. Maybe you create purchase orders in your ERP system for each item. Or add them as checklist items to another Tallyfy task. The loop handles it row by row.
Here’s the reality - Tallyfy webhooks and API responses speak JSON. You need to understand that language.
- Why parse JSON from Tallyfy? Power Automate receives JSON strings from Tallyfy (think webhook payloads or API responses). The Parse JSON action turns that text into actual objects and properties you can work with. No parsing means no access to the data inside.
- Using the “Parse JSON” action:
- Add the Parse JSON action from Data Operations
- Content: Drop in your JSON string from Tallyfy
- Schema: This defines the structure. Here’s the shortcut - click Generate from sample and paste in real JSON from a Tallyfy webhook or API call. Done.
Tallyfy example: Someone launches a process in Tallyfy. Your webhook fires off a JSON payload to Power Automate. Inside that JSON? Everything you need - process name, who started it, all the launch form data. But it’s just text until you parse it. Run it through “Parse JSON” and suddenly you can grab the initiator’s email for notifications, use the form data to update other systems, whatever you need.
Handling Tallyfy field types in Power Automate:
- Text fields: Straight mapping as strings - easy
- Dropdown fields: Need the display text? Use
item()?['fieldName']?['text']
after parsing - Checkbox fields: You get an array of what’s checked. Loop through it or grab specific items by index
- Table fields: Each row is an object in an array. You’ll need loops here
- Date fields: Comes as ISO format. Make it pretty with
formatDateTime()
Need to turn Tallyfy data into reports? These two actions have you covered:
- Create CSV Table: Feed it an array of Tallyfy task details. Get back a CSV string ready for Excel
- Create HTML Table: Same idea, but outputs an HTML table you can drop right into an email
Tallyfy use cases:
- Pull all overdue tasks for a project using the Tallyfy connector or API
- Run them through Create CSV Table for a downloadable report
- Or use Create HTML Table to email a nicely formatted summary to stakeholders
Time to put it all together with a real workflow.
Scenario: Your team lead wants a daily email showing all their Tallyfy tasks due today. Nice HTML format, arrives at 8 AM sharp.
-
Trigger: Recurrence. Set to run daily. (See understanding Power Automate basics for trigger types).
-
Action: Get user profile (V2) (Office 365 Users). (Optional, if needing assignee details beyond email for Tallyfy interaction).
-
Action: Tallyfy - “List tasks”.
- Set up your Tallyfy connection
- Assigned To User Email: Your team lead’s email
- Status: Filter for
Open
orIn Progress
tasks - Due Date: The basic connector might not filter by exact date. Two options here - grab all open tasks and filter them yourself, or hit the Tallyfy API directly for better filtering
-
(Alternative) Control: “Filter array” (Data Operation).
- From: Use the
value
(list of tasks) output from the “List tasks” Tallyfy action. - Condition: Use an expression to filter tasks where due date is today. Example:
@equals(formatDateTime(item()?['dueDate'], 'yyyy-MM-dd'), formatDateTime(utcNow(), 'yyyy-MM-dd'))
- From: Use the
-
Action: Initialize variable.
- Name:
DailyTaskReportHTML
- Type:
String
- Value: (Leave empty or add HTML table headers:
<table><tr><th>Task Name</th><th>Due Date</th></tr>
)
- Name:
-
Control: “Apply to each”.
- Select an output from previous steps: Use the output from the “List tasks” action (or the “Filter array” action if you used it).
-
Inside “Apply to each”: Action - “Append to string variable”.
- Name:
DailyTaskReportHTML
- Value: Build your table row by row:
<tr><td>[Task Name dynamic content]</td><td>[Due Date dynamic content formatted nicely]</td></tr>
(Pro tip: useformatDateTime()
to make those dates readable)
- Name:
-
(Outside “Apply to each”) Action: Set variable (Optional).
- Close off your table with
</table>
if you started with headers
- Close off your table with
-
Action: Send an email (V2).
- To: Team lead’s email
- Subject:
Your Tallyfy Tasks Due Today
- Body: Switch to code view (
</>
) and drop in yourDailyTaskReportHTML
variable. Make sure HTML rendering is enabled!
- Initialize early: Put all your variable initializations right at the start. Keeps things organized.
- Array structures from Tallyfy: Watch out for arrays - they’re everywhere in Tallyfy data. Table form fields? Arrays. Multiple tasks from the API? Arrays. You’ll be using “Apply to each” a lot.
- Inspect with “Compose”: Can’t figure out what your data looks like? Drop in a “Compose” action and output your variable or Tallyfy data. It’s like console.log for Power Automate (yes, debugging is that simple).
Power Automate > Advanced conditions and expressions in Power Automate
Power Automate > Managing and monitoring Power Automate flows
Power Automate > Understanding Power Automate basics
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks