cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dbnok
Frequent Visitor

Flow integration with Planner missing some parameters

I am a newbie and trying to start out with automating the copy of a tasks from one plan to another.

 

I have been using the Actions "Get a task", "Get task details" followed by "Create a task", "Update a task", and "Update task details" with good success.

 

However, some parameters which appear in the "List tasks" Actions output are not available in those other Actions to create/update in a task. Put another way, there are parameters in the ListTasks_Response_V2 that are not present in either GetTask_Response_V2 or GetTaskDetails_Response. For example, the parameters value.createdBy.user.displayName, value.createdBy.user.id, and value.completedDateTime.

 

Is there any means by which I can obtain the values for those unavailable parameters from my source task and then apply those values to the parameters of my target task?

4 REPLIES 4
v-yamao-msft
Community Support
Community Support

Hi @dbnok ,

 

Do you want to get parameters “value.createdby.user.displayName” and “value.createdBy.user.id” from an individual Planner task?

 

I am afraid that not all the parameters could be retrieved from action Get a task and Get task details. Here is one of the similar requests from Flow Ideas Forum, please vote it:

https://powerusers.microsoft.com/t5/Flow-Ideas/Planner-get-more-details-from-a-task-in-planner-e-g-C...

 

You may also try using the following workaround to get the two parameters you want. You may need to add a Condition to find out the specific task from action List tasks, then get corresponding parameters from action List tasks.

 

An image for your reference.

1.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yamao-msft 

Thanks for the response.  Yes that confirms that I can read those parameters from a task, but now how do I set/update those parameters on the target task of interest?  For example, I can't use 'Update a task' or 'Update task details' to update the value.completedDateTime for a given task, so is there a way using a 'Compose' or some other data API to do so?

Hi @dbnok ,

 

Thanks for updating.

 

I am afraid that it might be not possible to achieve your goal directly.

 

However, you could try with Custom APIs to insert to update completed date time for a given task.

 

You could also submit a request on this feature at Flow Ideas Forum:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

Best regards,

Mabel

 

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-yamao-msft 

 

I thought I had an idea how to make it work, but the result failed:

1. I created a task (it is the only task in the plan)

2. After some time I marked the task as completed

3. In my Flow, I do the following:

  - List tasks

  - Using Apply to each

  -Set a string variable to the 'createdDateTime' using the Flow GUI:

 

{
    "inputs": {
        "name": "SrcTaskDate",
        "value": "@items('Apply_to_each')?['createdDateTime']"
    }
}

  - I then do the same "Set" for the 'completedDateTime':

{
    "inputs": {
        "name": "SrcTaskDate",
        "value": "@items('Apply_to_each')?['completedDateTime']"
    }
}

  - I use a "Compose" with the following expression to try and set the 'completedDateTime' property:

    setProperty(items('Apply_to_each'),'completedDateTime',items('Apply_to_each')?['createdDateTime'])

    which generates code as:

{
    "inputs": "@setProperty(items('Apply_to_each'),'completedDateTime',items('Apply_to_each')?['createdDateTime'])"
}

  - After this I just set the string variable again to the completedDateTime to see what is retrived

 

When I debug the Flow, I see the following dates being assigned to my string variable:

    2019-08-05T11:47:48.5431951Z  <-- created
    2019-08-05T12:37:24.2542618Z  <-- completed

Those represent the created and completed dates respectively, corresponding to when I took action in  MS Planner.

 

My "Compose" shows the completedDateTime property as I expect:

   "completedDateTime": "2019-08-05T11:47:48.5431951Z"

Since the code was intended to set the completed time equal to the created time.

 

But, after the Compose: when I set the string variable to the completedDateTime from the item, it still shows the same date:

  2019-08-05T12:37:24.2542618Z

My Flow is very simple:

image.png

 

The full text of the Compose is like this:

{
  "@odata.etag": "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAUCc=\"",
  "planId": "<<redacted>>",
  "bucketId": "<<redacted>>",
  "title": "Try1",
  "orderHint": "8586366012169343856",
  "assigneePriority": "8586366012169343856",
  "percentComplete": 100,
  "startDateTime": null,
  "createdDateTime": "2019-08-05T11:47:48.5431951Z",
  "dueDateTime": null,
  "hasDescription": false,
  "previewType": "automatic",
  "referenceCount": 0,
  "checklistItemCount": 0,
  "activeChecklistItemCount": 0,
  "conversationThreadId": null,
  "id": "<<redacted>>",
  "createdBy": {
    "user": {
      "displayName": null,
      "id": "<<redacted>>"
    }
  },
  "completedBy": {
    "user": {
      "displayName": null,
      "id": "<<redacted>>"
    }
  },
  "appliedCategories": {},
  "assignments": {
    "<<redacted>>": {
      "@odata.type": "#microsoft.graph.plannerAssignment",
      "assignedDateTime": "2019-08-05T11:47:48.5431951Z",
      "orderHint": "",
      "assignedBy": {
        "user": {
          "displayName": null,
          "id": "<<redacted>>"
        }
      }
    }
  },
  "_assignments": [
    {
      "userId": "<<redacted>>",
      "value": {
        "@odata.type": "#microsoft.graph.plannerAssignment",
        "assignedDateTime": "2019-08-05T11:47:48.5431951Z",
        "orderHint": "",
        "assignedBy": {
          "user": {
            "displayName": null,
            "id": "<<redacted>>"
          }
        }
      }
    }
  ],
  "completedDateTime": "2019-08-05T11:47:48.5431951Z"
}

Any idea why my attempt at using "setProperty" isn't working properly?  It looks like it is indeed setting the property on the item, based on the Compose output, but items('Apply_to_each')?['completedDateTime']" does not seem to reflect the udpate??

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,408)