The goal is to extract the bucket name of the task from the planner and map it to Scorecard metrics' Status.
While the logic and aftermath evidence in the PowerAutomate Flow shows the bucket name is grabbed correctly for the corresponding task, the scorecard is not reflecting the correct status instead it displays randomly Completed
or Done
or Not Started
for all the tasks ! but the real bucket names are as below
Tried the following:
Compose
to gather the bucket name is structural way and then give it to Create a Goal
Status. Additionally, tried trimming the bucket name within the Compose
too ! but even then there is no change is the metrics statusSet up of the Flow:
Missing expression are as follows:
Name field of the Create a Goal is filled with items('ForEachTasks')?['title']
which is coming from Tasks mapping above
Input to LoopToFindBucket is outputs('List_buckets')?['body/value']
Condition comparison expression is
items('ForEachTasks')?['Status']
is equal to items('LoopToFindBucketName')?['id']
Update a Goal Status expression is outputs('Compose')
Flow run successfully and can see the bucket name is collected correctly in the Update a Goal
status
But in Scorecard, the gathered Status is not displayed
References: https://powerusers.microsoft.com/t5/Building-Flows/Getting-bucket-Name/td-p/171129
But in Scorecard, Although Status has showing bucket names but its not mapping correctly, e.g. this tasks supposed to have Blocked/On hold
.
It seems you can only set the status to the predefined enum of statuses.
Flow save failed with code 'OpenApiOperationParameterValidationFailed' and message 'Input parameter 'Goal' validation failed in workflow operation 'Update_a_goal': The API operation 'UpdateGoal' requires the property 'Goal/status' to be set to one of its defined enum values '["Leave unchanged","Not started","On track","At risk","Behind","Overdue","Completed"]' but is set to 'Peanuts'.'.
A possible solution is to create a new Compose with the following:
{
"In Progress - Implementation": "On track",
"Bucket name 1": "Not started",
"Bucket name 2": "At risk"
// and so on
}
Then in your Update a goal
action, for the Status
, use this expression:
outputs('MapStatus')?[trim(items('LoopToFindBucketName')?['name'])]
Where MapStatus
is the name of the Compose action with the above Json object mapping dictionary.