Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Copying Labels/Categories in a Planner Tasks Flow

Like (0) ShareShare
ReportReport
Posted on 6 Mar 2023 00:11:13 by 9

Hello,

 

I've put together a flow that creates a new task whenever I complete an old task. Everything works correctly except for getting the label/category from the old task to correctly be added to the new task. I found another thread that had some suggestions but those didn't seem to work for me. I feel like I'm close to getting this to work but I need a little help to figure out why it isn't working.

 

A high-level example of what I'm doing:

 

Test Inspection (old task): Due Date - 05 MAR 2023 ---> Test Inspection (newly created task through flow): Due Date - 04 APR 2023.

 

I'm able to get everything to copy over correctly, like I said above, except the category. Here is what I have in my flow:

 

Neverous_1-1678061153884.png

 

The formula I'm using is: not(empty(string(triggerOutputs()?['body/appliedCategories/category1'])))

 

I've applied this to all the categories I'm using and have updated the formula to show category1, category2, etc. as applicable.

 

Neverous_0-1678061089926.png

 

However, my flow is not adding a category to the new task it creates. When I check to see the outputs, I see that FALSE is what has been listed. Could someone let me know what I did incorrectly here?

 

Thank you,

  • Mrudd Profile Picture
    20 on 13 Jun 2024 at 16:44:24
    Re: Copying Labels/Categories in a Planner Tasks Flow

    I know this is a little old, but I was trying to do something similar with copying tasks from one plan to another.

    I found that the label values returned when using "List Tasks" was a cleverly formatted array, not independent values for each category.   Meaning its not returning 'appliedCategories/category1' = true.  It's returning 'appliedCategories' = '"category1":true'

    Since it doesn't list labels that aren't assigned in the result, you only need to look for 'category#' in the response. The expression to use in each color of the create task function would be:

    if(contains(items('For_each')?['appliedCategories'], 'category1'), true, false)

    That is for Pink, then 'category2' for Red and so on. (mine is in a For_each because I am copying many tasks in my flow)

     

    Hope that helps others who are trying to figure out how to copy the labels from one task to another.

  • wind0soft Profile Picture
    38 on 25 Oct 2023 at 22:50:26
    Re: Copying Labels/Categories in a Planner Tasks Flow

    Hi @grantjenkins 

    I have not been able to get your expression for the labels to work, but I don't think your expression is the problem.  

    coalesce(triggerOutputs()?['body/appliedCategories/category1'], false)

     Ultimately what I'm trying to do is copy a plan from one team to another newly created team.  I have everything working, even descriptions and references.  But I CAN NOT get the labels to work! Please help

    wind0soft_0-1698272743264.png

     

    This flow runs fine but for some reason the pink category is not populated.

     

    This is the json from the list tasks for a true statement for category 1

     {
                    "@odata.etag""W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAUCc=\"",
                    "planId""AyG9JG0bIEmSKLhx6iF9s2QAC8ra",
                    "bucketId""uurRAhSdmUi27hPAF8yhy2QAET0E",
                    "title""Solution prep",
                    "orderHint""8585033639174938048P/",
                    "assigneePriority""",
                    "percentComplete"0,
                    "createdDateTime""2023-10-25T14:10:28.0150271Z",
                    "hasDescription"true,
                    "previewType""automatic",
                    "referenceCount"0,
                    "checklistItemCount"0,
                    "activeChecklistItemCount"0,
                    "priority"5,
                    "id""3fUDHXkn-EituWxVtaSSwGQAIPCv",
                    "createdBy": {
                        "user": {
                            "id""fc1c40d6-db02-4894-a723-f541f44ece27"
                        },
                        "application": {
                            "displayName"null,
                            "id""09abbdfd-ed23-44ee-a2d9-a627aa1c90f3"
                        }
                    },
                    "appliedCategories": {
                        "category1"true,
                        "category2"true
                    },
                    "assignments": {},
                    "_assignments": []
                }
    Yet, when it goes to create the task Pink is false
    wind0soft_1-1698273014341.png

     

    And is there a way to use the value Pink from the get tasks?  If I just put value Pink in the flow it errors out because value Pink is equal to "null".  

    wind0soft_2-1698273771202.png

     

     

     

     

  • Neverous Profile Picture
    9 on 07 Mar 2023 at 04:27:25
    Re: Copying Labels/Categories in a Planner Tasks Flow

    Thank you both for the help. I looked through my expressions and didn't see any obvious typos. Using the coalesce(triggerOutputs()?['body/appliedCategories/category1'], false) expression resolved my issue.

    image001.png

  • Verified answer
    grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on 06 Mar 2023 at 12:03:35
    Re: Copying Labels/Categories in a Planner Tasks Flow

    Can you try the following expression and see if it works as expected.

     

    coalesce(triggerOutputs()?['body/appliedCategories/category1'], false)


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • Expiscornovus Profile Picture
    31,652 Most Valuable Professional on 06 Mar 2023 at 11:44:42
    Re: Copying Labels/Categories in a Planner Tasks Flow

    Hi @Neverous,

     

    Your expression looks alright.

     

    Might be worth double checking your expressions for typos. I would suggest to check your category expression mappings in the peek code/code view of the create task v3 action.

     

    peekcode_parameters.png

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