Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
Expand all | Collapse all

Update Label on a Planner Task

  • 1.  Update Label on a Planner Task

    Posted Jun 30, 2019 06:44 AM
    Hi everyone,

    I am trying to update the label on a planner task via the update task flow actions.

    I cannot see any option to do this, can anyone confirm if this is possible yet or if the function is yet to be released by Microsoft?

    Thank you in advance.

    Karl

    ------------------------------
    Karl Bolland
    KnipeBolland
    ------------------------------


  • 2.  RE: Update Label on a Planner Task

    Gold Contributor
    Posted Jul 01, 2019 02:37 AM
    Hi,

    Updating labels in Planner via Flow is not available.

    See sources here and there
    https://powerusers.microsoft.com/t5/Flow-Ideas/Update-label-of-a-planner-task/idi-p/177656
    https://powerusers.microsoft.com/t5/General-Flow-Discussion/Update-Text-property-of-Label-in-Planner-Task/td-p/63162
    https://powerusers.microsoft.com/t5/Flow-Ideas/Flow-to-update-label-of-task-in-Planner/idi-p/181469

    Regards

    ------------------------------
    David Gerard
    Buisness Intelligence Consultant
    Kampala
    ------------------------------



  • 3.  RE: Update Label on a Planner Task

    Posted Jul 01, 2019 08:06 AM
    Edited by Tiago Paes Jul 01, 2019 08:11 AM
    It's not immediately possible using OOB flow activities, but you can do it by making REST requests to the Graph api.

    You can, for example:

    Make a Get request against the plan:​
    https://graph.microsoft.com/v1.0/planner/plans/@{variables('planId')}/details

    This gives you some details with the following Schema:
    {
        "type": "object",
        "properties": {
            "@@odata.context": {
                "type": "string"
            },
            "@@odata.etag": {
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "sharedWith": {
                "type": "object",
                "properties": {
                    
                }
            },
            "categoryDescriptions": {
                "type": "object",
                "properties": {
                    "category1": {},
                    "category2": {},
                    "category3": {},
                    "category4": {},
                    "category5": {},
                    "category6": {}
                }
            }
        }
    }

    You can make a PATCH request to the same URL, with, for example:
    HEADERS:
    IF-MATCH: ETAG from previous request
    
    
    
    {
      "categoryDescriptions": {
        "category5": "Project Online"
      }
    }

    This will update the label for you.

    Unfortunately the requests I made when I developed this were using Username and Password authentication with a service account - not sure that can be bypassed.


    You can use the Graph Explorer https://developer.microsoft.com/en-us/graph/graph-explorer to test out the requests

    EDIT: Realised I shared how to rename categories fro the plan and not how to select the category on a task:

    To select a category you make a PATCH request as follows:

    You need to perform a GET against the URL to get the correct E-TAG of the task

    PATCH: https://graph.microsoft.com/v1.0/planner/tasks/@{variables('planner task Id')}

    Headers (plus the standard ones)

    IF-MATCH: recovered ETAG - it does not accept IF-MATCH: *
    Body:
    {
      "appliedCategories": {
        "category5": true
      }
    }






    ------------------------------
    Tiago Paes
    Senior Architect @ ProActive

    ------------------------------



  • 4.  RE: Update Label on a Planner Task

    Posted Jul 04, 2019 04:02 AM
    Hi Thanks for your replies.

    I have tried your suggestion Tiago, but the flow is writing back to multiple planners so would take a long time to implement. So I have voted up the idea on the UserVoice in the hope Microsoft will release it soon.

    Thanks again for your help.




    ------------------------------
    Karl Bolland
    ------------------------------



  • 5.  RE: Update Label on a Planner Task

    Posted Jul 04, 2019 04:28 AM
    No problem - My follow up recommendation, if you don't want to wait for MS, would be to create a Helper flow using the Request trigger and Response activities to create one flow that receives the Plan ID and other needed information and performs the necessary actions.

    I've added my upvote on the idea to try and help out :)

    ------------------------------
    Tiago Paes
    Senior Architect
    Frederiksberg
    4553638846
    ------------------------------