The goal is to extract the bucket name of the task from the planner and map it to Scorecard metrics' Status.
- Task == Metric
- Bucket name == 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
- Blocked/On hold
- In Progress - Review
- Backlog - Prioritized & Scoped
- Completed
- Done
Tried the following:
- Renamed the Metrics'Status in advance in scorecard directly(manually) so that mapping could be straight forward for PowerAutomate/Flow but its of no use
- Used
Composeto gather the bucket name is structural way and then give it toCreate a GoalStatus. Additionally, tried trimming the bucket name within theComposetoo ! but even then there is no change is the metrics status
Set 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 aboveInput to LoopToFindBucket is
outputs('List_buckets')?['body/value']Condition comparison expression is
items('ForEachTasks')?['Status']is equal toitems('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
Update
- Flow result after new mapping with additional Compose
- Status here correctly shows At Risk which is mapped to Blocked/On hold
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.
A possible solution is to create a new Compose with the following:
Then in your
Update a goalaction, for theStatus, use this expression:Where
MapStatusis the name of the Compose action with the above Json object mapping dictionary.