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:

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??