Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

Export Planner task status as text instead of percentage (Power Automate)

Posted on November 14, 2021November 14, 2021 by Tom

“Power Automate allows me to get the progress from a Planner task as a percentage rather than as ‘Not started’, ‘In progress’, or ‘Completed’ text.”


As already shown in previous articles, the data from Planner isn’t very user friendly. Additionally to the user information displayed as user id that needs processing, there’s also the actual task status. You might expect the words ‘Not started’, ‘In progress’ and ‘Completed’ somewhere in the data, but it’s not there. Instead you’ve got the ‘percentComplete’ field. A number. If you want the status as a text, you must convert it by yourself. And this post will show you how to do that.

Power Automate planner task percentage

Use the ‘Switch’ action

One solution is to use a variable and a ‘Switch’ action for the translation. As it’s an extra action, it’s a viable solution only if you process the tasks one by one in a loop. For example, if you export them to a SharePoint list or an Excel file.

The main piece of information is the mapping between percentage and status. If the ‘percentComplete’ is 0, the task is ‘Not started’. 100 means that the task is ‘Completed’, and anything in between (50 to be exact) is ‘In progress’. Knowing this you can ‘Initialize variable’ as a string and add a ‘Switch’ based on the ‘percentComplete’ value. Set the variable to the corresponding text, and use it as the task status later.

Use an expression

The other option is to use an expression. This is a solution you use when creating a HTML table or a csv file with the tasks. Since the ‘Create HTML table’ or ‘Create csv table’ actions process the whole array, you can’t preprocess the data as above. You must do all the processing directly in that action. And as such, you’ll need multiple if(…) expressions.

if 'percentComplete' = 100, use status 'Completed'
else if 'percentComplete' = 0, use status 'Not started'
otherwise use status 'In progress'

Translated to a Power Automate expression:

if(
  equals(item()?['percentComplete'],100),
  'Completed',
  if(equals(item()?['percentComplete'],0),
    'Not started',
    'In progress')
)
Power Automate planner task percentage

Summary

When you export tasks from Planner with Power Automate, you’ll receive only the completion percentage for each task. If you need text description, it’s up to you to translate them. The expression can be used anywhere, even though it’s a bit more complicated. On the other side the ‘Switch’ is easier to understand, but it can be used only in a loop.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with 1000s of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes