Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Struggling with Planner category descriptions

Like (0) ShareShare
ReportReport
Posted on 13 Oct 2023 22:41:45 by 7

Hello there!

 

I'm struggling a bit to get a kind of weird flow up and running. I just joined a team and I'm trying to create a condition where Planner tasks that have an applied category (called labels in the Planner UI) where the category description text contains the word "Change" are cloned to another Planner board. Matching the category description as opposed to the color or the category number is key, because there are many planner boards, and everyone chose a different category for tracking Changes that need to be approved by CAB.

 

Here's where I'm at:

- I initialize an array value called plan_categoryDescriptions

- I use a Get plan details (preview) step to get the category descriptions from the plan

- I use a Set variable step for plan_categoryDescriptions to convert the Category descriptions Dynamic content from the previous step into an array (they are returned JSON objects so I kept getting errors trying to use a Apply to each step)

 

This is where I get lost - I want to read each of the properties in the array to see if any of the category descriptions contain the word "Change" using an Apply to each step but it keeps consuming the entire array in a single step instead of going line by line. I proved this out by completing the Apply to each step with a condition to write the Properties to a OneNote. Instead of getting multiple lines for each property, I get one big line. What am I doing wrong? Is it in the step where I convert the Category descriptions objects into an array?

dhansell_1-1697236723898.png

dhansell_0-1697236991721.png

 

 

dhansell_2-1697236746569.png

 

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on 22 Oct 2023 at 06:22:40
    Re: Struggling with Planner category descriptions

    Hi @dhansell 

     

    You could get the category number by using the below expression:

    ManishSolanki_0-1697955676352.png

    xpath(xml(json(concat('{"root": { value:',outputs('Get_plan_details')?['body/categoryDescriptions'], '}}'))), concat('name(//root/value/*[contains(text(),','''','Change','''',')])'))

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • dhansell Profile Picture
    7 on 18 Oct 2023 at 21:27:57
    Re: Struggling with Planner category descriptions

    @ManishSolanki -

    OK, I've run into another problem. Once I've determined which categoryDescription contains the word "Change", I want to return that category number (e.g., category1) so I can compare it against a created Planner Task's appliedCategories.

     

    How the heck do I capture the key that matches the description so I can Apply to each on the Task's appliedCategories to see if it's $true? 

  • dhansell Profile Picture
    7 on 17 Oct 2023 at 14:43:20
    Re: Struggling with Planner category descriptions

    @ManishSolanki - this worked perfectly! Thank you so much for helping out a noobus - I don't have much experience with writing expressions so this will help me with other tasks in the future, too. Really appreciate you.

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on 14 Oct 2023 at 03:29:53
    Re: Struggling with Planner category descriptions

    Hi @dhansell 

     

    To convert task categories to array, you need to write an expression in the set variable action. Pls set the value of variable as:

    xpath(xml(json(concat('{"Root":{"Item":',outputs('Get_plan_details')?['body/categoryDescriptions'],'}}'))),'//text()')

    You will get the array of categories in variable.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started
Loading started