web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copying Labels/Categor...
Power Automate
Unanswered

Copying Labels/Categories in a Planner Tasks Flow

(0) ShareShare
ReportReport
Posted on 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,

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    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

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    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.

  • Neverous Profile Picture
    9 on at

    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

  • wind0soft Profile Picture
    38 on at

    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

     

     

     

     

  • Mrudd Profile Picture
    20 on at

    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard