Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Triggers
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
  • Get help with 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!


NEW! Master the HTTP requests to SharePoint with a new cheat sheet!

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.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Use Power Automate to forward Outlook events upon registrationJanuary 29, 2023
  • Why the condition is false for the same numbers (Power Automate)January 25, 2023
  • How to forward event invitation to other calendar (Power Automate)January 22, 2023
  • Run ‘For selected item’ flow from non-default environment (Power Automate)January 18, 2023
  • Hide button in SharePoint list after Power Automate flow startedJanuary 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes