{"id":1335,"date":"2024-12-02T19:53:00","date_gmt":"2024-12-03T00:53:00","guid":{"rendered":"https:\/\/automatethemundane.com\/index.php\/2024\/12\/02\/automatic-code-review-of-power-automate-flows-with-power-platform-pipelines\/"},"modified":"2024-12-02T20:02:36","modified_gmt":"2024-12-03T01:02:36","slug":"automatic-code-review-of-power-automate-flows-with-power-platform-pipelines","status":"publish","type":"post","link":"https:\/\/automatethemundane.com\/index.php\/2024\/12\/02\/automatic-code-review-of-power-automate-flows-with-power-platform-pipelines\/","title":{"rendered":"Automatic Code Review of Power Automate Flows with Power Platform Pipelines"},"content":{"rendered":"\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">In my previous <a href=\"https:\/\/www.notion.so\/14d31ce14d2c809e99bfdc384b107d7a\">post<\/a>, I integrated a power apps code review tool with Power Platform Pipelines. The tool that the Power CAT team had built was amazing and gave me some ideas on how I could handle doing reviews of Power Automate flows. <\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">Building off of the last process, I have added three flows. 1.2.2 that will start the flows check process, 1.2.2.1 that will check for blank descriptions, and 1.2.2.2 that checks for default names<\/p>\n\n\n\n<div class=\"wp-block-wp-mermaid-block mermaid\">\nflowchart TD\n    A[1.2 - When a push to test happens] -->|Solution Name &amp; Solution Version &amp; Stage Run ID &amp; ArtifactID| B[1.2.1 - Start App Review]\n    A--> |StageRunID &amp; ArtifactID| C[1.2.2 - Start Flow Review]\n    C --> |CloudFlows &amp; Counter| D[1.2.2.1 - Flow Blank Descriptions Check]\n    C --> |CloudFlows| E[1.2.2.2 - Default Name Check]\n<\/div>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-wp-mermaid-block mermaid\">\nerDiagram\n\n\"Power Automate Code Rules\"}| -- || \"Code Review Scoring\":contains\n\"Power Automate Code Reviews\"{\nGUID CodeReview PK\ndec DescriptionScore\ndec DefaultNameScore\ndec FinalScore\n}\n\"Power Automate Code Rules\"{\nstring Rulename PK\nGUID CodeReviewScoring FK\nstring Rule\n}\n\"Code Review Scoring\"{\nstring Scorename PK\ndec Rating \n}\n\n<\/div>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">\u00a0<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 The column FinalScore is a PowerFX column that adds the two scores then divides them by two<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>('Description Score' + 'Default Name Score') \/ 2<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">All three tables are added to an MDA for management <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-74-1024x371.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Review Scorings<\/h2>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">There are six Review Scores in the table<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-75-1024x282.png\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Review Rules<\/h2>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">Two review rules are added into the table<\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-76-1024x148.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">The default action names will have a list of default action names and have a score of Low<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-77-1024x438.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">The blank descriptions rule will be set to null and a score of informational <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-78-1024x172.png\" alt=\"\"\/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>1.2.2 - Start Flow Review<\/strong><\/h1>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A manual trigger that calls for the solution version and the solution name followed by three variables\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-79.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-80.png\" alt=\"\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>varCloudFlows - Array<\/li>\n\n\n\n<li>varCounter - Integer<\/li>\n\n\n\n<li>varFlowDesctiptionsArray - Array<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>A Scope with three actions \n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-81.png\" alt=\"\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first action will list all rows from the solutions table in the development environment using a FetchXML query and the SolutionName from the trigger\n\n<pre class=\"wp-block-code\"><code>&lt;fetch&gt;\n  &lt;entity name=\"solution\"&gt;\n    &lt;attribute name=\"friendlyname\" \/&gt;\n    &lt;attribute name=\"solutionid\" \/&gt;\n    &lt;attribute name=\"uniquename\" \/&gt;\n    &lt;filter&gt;\n      &lt;condition attribute=\"uniquename\" operator=\"eq\" value=\"@{triggerBody()?&#91;'text']}\" \/&gt;\n    &lt;\/filter&gt;\n  &lt;\/entity&gt;\n&lt;\/fetch&gt;<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>Next will be another list all rows from the solution components table in development using a FetchXML\n\n\n<pre class=\"wp-block-code\"><code>&lt;fetch&gt;\n  &lt;entity name=\"solutioncomponent\"&gt;\n    &lt;attribute name=\"objectid\" \/&gt;\n    &lt;filter type=\"and\"&gt;\n      &lt;condition attribute=\"solutionid\" operator=\"eq\" value=\"@{outputs('List_rows_from_selected_environment_-_Solutions')?&#91;'body\/value']?&#91;0]?&#91;'solutionid']}\" \/&gt;\n    &lt;\/filter&gt;\n    &lt;filter&gt;\n      &lt;condition attribute=\"componenttype\" operator=\"eq\" value=\"29\" \/&gt;\n    &lt;\/filter&gt;\n  &lt;\/entity&gt;\n&lt;\/fetch&gt;<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 I am filtering the component type by 29 (workflows)<\/p>\n<\/li>\n\n\n\n<li>For each workflow a get row by id in the process table from the development environment \n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-82.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-83.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>A condition that checks if the process is a modern cloud flow\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-84.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-85.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>If it is a modern flow, then it is added to the array varCloudFlows and increments the counter by 1\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-86.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-87.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>Two child flows are then triggered \n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-88.png\" alt=\"\"\/><\/figure>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-89.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">&nbsp;<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-90.png\" alt=\"\"\/><\/figure>\n<\/div>\n<\/div>\n<\/li>\n\n\n\n<li>After the 1.2.2.1 a scope is added with three actions<\/li>\n\n\n\n<li>The Parse JSON will convert a string that is returned by the 1.2.2.1 flow back to an array\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-91.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"type\": \"array\",\n    \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n            \"ProcessGUID\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"@@odata.type\": {\n                        \"type\": \"string\"\n                    },\n                    \"@@odata.id\": {\n                        \"type\": \"string\"\n                    },\n                    \"@@odata.etag\": {\n                        \"type\": \"string\"\n                    },\n                    \"@@odata.editLink\": {\n                        \"type\": \"string\"\n                    },\n                    \"objectid@odata.type\": {\n                        \"type\": \"string\"\n                    },\n                    \"objectid\": {\n                        \"type\": \"string\"\n                    },\n                    \"solutioncomponentid@odata.type\": {\n                        \"type\": \"string\"\n                    },\n                    \"solutioncomponentid\": {\n                        \"type\": \"string\"\n                    }\n                }\n            },\n            \"ProcessName\": {\n                \"type\": \"string\"\n            },\n            \"ProcessDescription\": {},\n            \"DescriptionScore\": {\n                \"type\": \"number\"\n            }\n        },\n        \"required\": &#91;\n            \"ProcessGUID\",\n            \"ProcessName\",\n            \"ProcessDescription\",\n            \"DescriptionScore\"\n        ]\n    }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>For each of the items out of the Parse JSON an item is added to the array varFlowDesctiptionsArray\n\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-92.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-93.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 For the Process Description an if expression is used. If it is blank then Description Missing is added<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if(empty(item()?&#91;'ProcessDescription']), 'Description Missing', item()?&#91;'ProcessDescription'])\n<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>This array is then converted to a HTML table using Automatic column headers\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-94.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>The last two action are a add a new row to Code Reviews and respond to a flow\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-95.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>The add new row will be configured as follows\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-96.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 This add is optional. If you do not want the outputs to be stored in both the pipeline environment and the production environment you can skip this. <\/p>\n<\/li>\n\n\n\n<li>The last step will be to respond to the parent flow\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"type\": \"Response\",\n  \"kind\": \"PowerApp\",\n  \"inputs\": {\n    \"schema\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"defaultnamescore\": {\n          \"title\": \"DefaultNameScore\",\n          \"type\": \"number\",\n          \"x-ms-content-hint\": \"NUMBER\",\n          \"x-ms-dynamically-added\": true\n        },\n        \"defaultnamedescriptions\": {\n          \"title\": \"DefaultNameDescriptions\",\n          \"type\": \"string\",\n          \"x-ms-content-hint\": \"TEXT\",\n          \"x-ms-dynamically-added\": true\n        },\n        \"descriptionscore\": {\n          \"title\": \"DescriptionScore\",\n          \"type\": \"number\",\n          \"x-ms-content-hint\": \"NUMBER\",\n          \"x-ms-dynamically-added\": true\n        },\n        \"descriptionsoutput\": {\n          \"title\": \"Descriptionsoutput\",\n          \"type\": \"string\",\n          \"x-ms-content-hint\": \"TEXT\",\n          \"x-ms-dynamically-added\": true\n        }\n      },\n      \"additionalProperties\": {}\n    },\n    \"statusCode\": 200,\n    \"body\": {\n      \"defaultnamescore\": \"@body('Run_a_Child_Flow_1.2.2.2')?&#91;'defaultnamescore']\",\n      \"defaultnamedescriptions\": \"@{body('Run_a_Child_Flow_1.2.2.2')?&#91;'defaultnameactions']}\",\n      \"descriptionscore\": \"@body('Run_a_Child_Flow_-_1.2.2.1')?&#91;'score']\",\n      \"descriptionsoutput\": \"@{body('Run_a_Child_Flow_-_1.2.2.1')?&#91;'descriptions']}\"\n    }\n  },\n  \"runAfter\": {\n    \"Add_a_new_row_-_Code_Reviews\": &#91;\n      \"Succeeded\"\n    ]\n  },\n  \"metadata\": {\n    \"operationMetadataId\": \"18d71153-94ce-447e-94a9-a8468d37cadd\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.2.2.1 - Flow Blank Descriptions Check<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A manual trigger followed by a Parse JSON and two variables\n\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-97.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"type\": \"array\",\n    \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n            \"ProcessGUID\": {\n                \"type\": \"string\"\n            },\n            \"ProcessName\": {\n                \"type\": \"string\"\n            },\n            \"ProcessClientData\": {\n                \"type\": \"string\"\n            },\n            \"ProcessDescription\": {}\n        },\n        \"required\": &#91;\n            \"ProcessGUID\",\n            \"ProcessName\",\n            \"ProcessClientData\",\n            \"ProcessDescription\"\n        ]\n    }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-98.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-99.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>A scope with two actions is next \n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-100.png\" alt=\"\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first will list the rows and find the rule for blank descriptions and gets its\u2019 subsequent score using FetchXML\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-101.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;fetch&gt;\n  &lt;entity name=\"andy_powerautomatereviewrules\"&gt;\n    &lt;filter&gt;\n      &lt;condition attribute=\"andy_rulename\" operator=\"eq\" value=\"Description is blank\" \/&gt;\n    &lt;\/filter&gt;\n    &lt;link-entity name=\"andy_codereviewscoring\" from=\"andy_codereviewscoringid\" to=\"andy_score\" alias=\"ScoreOutput\"&gt;\n      &lt;attribute name=\"andy_rating\" \/&gt;\n      &lt;attribute name=\"andy_scorename\" \/&gt;\n    &lt;\/link-entity&gt;\n  &lt;\/entity&gt;\n&lt;\/fetch&gt;<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>For workflow the description will be checked if it is blank \n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-102.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-103.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-104.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>If its blank it will be added to the variable varDescScores\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-105.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"type\": \"AppendToArrayVariable\",\n  \"inputs\": {\n    \"name\": \"varDescScores\",\n    \"value\": {\n      \"ProcessGUID\": \"@items('Apply_to_each_-_Check_if_workflow_is_blank')?&#91;'ProcessGUID']\",\n      \"ProcessName\": \"@items('Apply_to_each_-_Check_if_workflow_is_blank')?&#91;'ProcessName']\",\n      \"ProcessDescription\": \"@items('Apply_to_each_-_Check_if_workflow_is_blank')?&#91;'ProcessDescription']\",\n      \"DescriptionScore\": \"@outputs('List_rows_-_Blank_Review_Rule')?&#91;'body\/value']?&#91;0]?&#91;'ScoreOutput.andy_rating']\"\n    }\n  },\n  \"metadata\": {\n    \"operationMetadataId\": \"00665194-289c-4c09-a229-46824ca3a74c\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>Then the score is added to the variable varDescScore\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-106.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>If there is a description it will do the same thing, expect for the score f\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-107.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-108.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>It will then respond to the parent flow with the overall score and descriptions array \n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-109.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>The Score will divide the sum of all the scores by the amount of flows (Counter)\n\n<pre class=\"wp-block-code\"><code>div(variables('varDescScore'),triggerBody()?&#91;'number'])<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">1.2.2.2 - Default Name Check<\/h2>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">This flow was one of the hardest flows I have made. To get the names of the actions out of the flow was a brain teaser. Each of the actions names are stored within the client data column of the process table. It is stored as an array, but one that proved difficult to access the elements I wanted. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A manual trigger followed by 4 variables and a parse json is added\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-1.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-111.png\" alt=\"\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>varDefault Names - Array\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-112.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>varDefaultNameCounter - Interger\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-114.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>varDefaultNameScore - Float\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-115.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>varDefaultNamesScores - Array\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-116.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Parse JSON\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-117.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"type\": \"array\",\n    \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n            \"ProcessGUID\": {\n                \"type\": \"string\"\n            },\n            \"ProcessName\": {\n                \"type\": \"string\"\n            },\n            \"ProcessClientData\": {\n                \"type\": \"string\"\n            },\n            \"ProcessDescription\": {}\n        },\n        \"required\": &#91;\n            \"ProcessGUID\",\n            \"ProcessName\",\n            \"ProcessClientData\",\n            \"ProcessDescription\"\n        ]\n    }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>A scope with four actions is then added \n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-118.png\" alt=\"\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first action lists all the rules and the scores using a FetchXML query\n\n\n<pre class=\"wp-block-code\"><code>&lt;fetch&gt;\n  &lt;entity name=\"andy_powerautomatereviewrules\"&gt;\n    &lt;attribute name=\"andy_rule\" \/&gt;\n    &lt;filter&gt;\n      &lt;condition attribute=\"andy_rulename\" operator=\"eq\" value=\"Default Action Names\" \/&gt;\n    &lt;\/filter&gt;\n    &lt;link-entity name=\"andy_codereviewscoring\" from=\"andy_codereviewscoringid\" to=\"andy_score\" alias=\"ScoreOutput\"&gt;\n      &lt;attribute name=\"andy_rating\" \/&gt;\n      &lt;attribute name=\"andy_scorename\" \/&gt;\n    &lt;\/link-entity&gt;\n  &lt;\/entity&gt;\n&lt;\/fetch&gt;<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-119.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>The second parses the JSON for the rules\n\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-120.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>outputs('List_rows_-_Get_Default_Name_Rules')?&#91;'body\/value']?&#91;0]?&#91;'andy_rule']<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"type\": \"array\",\n    \"items\": {\n        \"type\": \"string\"\n    }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>Each rule is then added to the array variable varDefaultNames\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-121.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-122.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>A for loop is added for each workflow\n\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-2.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-124.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>body('Parse_JSON_-_CloudFlows')<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first step in the loop is to parse the JSON of the client data\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-126.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-127.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"type\": \"object\",\n    \"properties\": {\n        \"properties\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"connectionReferences\": {\n                    \"type\": \"object\",\n                    \"properties\": {}\n                },\n                \"definition\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"$schema\": {\n                            \"type\": \"string\"\n                        },\n                        \"contentVersion\": {\n                            \"type\": \"string\"\n                        },\n                        \"parameters\": {\n                            \"type\": \"object\",\n                            \"properties\": {\n                                \"$authentication\": {\n                                    \"type\": \"object\",\n                                    \"properties\": {\n                                        \"defaultValue\": {\n                                            \"type\": \"object\",\n                                            \"properties\": {}\n                                        },\n                                        \"type\": {\n                                            \"type\": \"string\"\n                                        }\n                                    }\n                                }\n                            }\n                        },\n                        \"triggers\": {\n                            \"type\": \"object\",\n                            \"properties\": {\n                                \"manual\": {\n                                    \"type\": \"object\",\n                                    \"properties\": {\n                                        \"metadata\": {\n                                            \"type\": \"object\",\n                                            \"properties\": {\n                                                \"operationMetadataId\": {\n                                                    \"type\": \"string\"\n                                                }\n                                            }\n                                        },\n                                        \"type\": {\n                                            \"type\": \"string\"\n                                        },\n                                        \"kind\": {\n                                            \"type\": \"string\"\n                                        },\n                                        \"inputs\": {\n                                            \"type\": \"object\",\n                                            \"properties\": {\n                                                \"schema\": {\n                                                    \"type\": \"object\",\n                                                    \"properties\": {\n                                                        \"type\": {\n                                                            \"type\": \"string\"\n                                                        },\n                                                        \"properties\": {\n                                                            \"type\": \"object\",\n                                                            \"properties\": {\n                                                                \"text\": {\n                                                                    \"type\": \"object\",\n                                                                    \"properties\": {\n                                                                        \"title\": {\n                                                                            \"type\": \"string\"\n                                                                        },\n                                                                        \"type\": {\n                                                                            \"type\": \"string\"\n                                                                        },\n                                                                        \"x-ms-dynamically-added\": {\n                                                                            \"type\": \"boolean\"\n                                                                        },\n                                                                        \"description\": {\n                                                                            \"type\": \"string\"\n                                                                        },\n                                                                        \"x-ms-content-hint\": {\n                                                                            \"type\": \"string\"\n                                                                        }\n                                                                    }\n                                                                },\n                                                                \"file\": {\n                                                                    \"type\": \"object\",\n                                                                    \"properties\": {\n                                                                        \"title\": {\n                                                                            \"type\": \"string\"\n                                                                        },\n                                                                        \"type\": {\n                                                                            \"type\": \"string\"\n                                                                        },\n                                                                        \"x-ms-dynamically-added\": {\n                                                                            \"type\": \"boolean\"\n                                                                        },\n                                                                        \"description\": {\n                                                                            \"type\": \"string\"\n                                                                        },\n                                                                        \"x-ms-content-hint\": {\n                                                                            \"type\": \"string\"\n                                                                        },\n                                                                        \"properties\": {\n                                                                            \"type\": \"object\",\n                                                                            \"properties\": {\n                                                                                \"name\": {\n                                                                                    \"type\": \"object\",\n                                                                                    \"properties\": {\n                                                                                        \"type\": {\n                                                                                            \"type\": \"string\"\n                                                                                        }\n                                                                                    }\n                                                                                },\n                                                                                \"contentBytes\": {\n                                                                                    \"type\": \"object\",\n                                                                                    \"properties\": {\n                                                                                        \"type\": {\n                                                                                            \"type\": \"string\"\n                                                                                        },\n                                                                                        \"format\": {\n                                                                                            \"type\": \"string\"\n                                                                                        }\n                                                                                    }\n                                                                                }\n                                                                            }\n                                                                        }\n                                                                    }\n                                                                }\n                                                            }\n                                                        },\n                                                        \"required\": {\n                                                            \"type\": \"array\",\n                                                            \"items\": {\n                                                                \"type\": \"string\"\n                                                            }\n                                                        }\n                                                    }\n                                                }\n                                            }\n                                        }\n                                    }\n                                }\n                            }\n                        },\n                        \"actions\": {\n                            \"type\": \"object\",\n                            \"properties\": {\n                                \"Compose\": {\n                                    \"type\": \"object\",\n                                    \"properties\": {\n                                        \"runAfter\": {\n                                            \"type\": \"object\",\n                                            \"properties\": {}\n                                        },\n                                        \"metadata\": {\n                                            \"type\": \"object\",\n                                            \"properties\": {\n                                                \"operationMetadataId\": {\n                                                    \"type\": \"string\"\n                                                }\n                                            }\n                                        },\n                                        \"type\": {\n                                            \"type\": \"string\"\n                                        },\n                                        \"inputs\": {\n                                            \"type\": \"string\"\n                                        }\n                                    }\n                                },\n                                \"Respond_to_a_Power_App_or_flow\": {\n                                    \"type\": \"object\",\n                                    \"properties\": {\n                                        \"runAfter\": {\n                                            \"type\": \"object\",\n                                            \"properties\": {\n                                                \"Compose\": {\n                                                    \"type\": \"array\",\n                                                    \"items\": {\n                                                        \"type\": \"string\"\n                                                    }\n                                                }\n                                            }\n                                        },\n                                        \"metadata\": {\n                                            \"type\": \"object\",\n                                            \"properties\": {\n                                                \"operationMetadataId\": {\n                                                    \"type\": \"string\"\n                                                }\n                                            }\n                                        },\n                                        \"type\": {\n                                            \"type\": \"string\"\n                                        },\n                                        \"kind\": {\n                                            \"type\": \"string\"\n                                        },\n                                        \"inputs\": {\n                                            \"type\": \"object\",\n                                            \"properties\": {\n                                                \"statusCode\": {\n                                                    \"type\": \"integer\"\n                                                },\n                                                \"body\": {\n                                                    \"type\": \"object\",\n                                                    \"properties\": {\n                                                        \"data\": {\n                                                            \"type\": \"string\"\n                                                        }\n                                                    }\n                                                },\n                                                \"schema\": {\n                                                    \"type\": \"object\",\n                                                    \"properties\": {\n                                                        \"type\": {\n                                                            \"type\": \"string\"\n                                                        },\n                                                        \"properties\": {\n                                                            \"type\": \"object\",\n                                                            \"properties\": {\n                                                                \"data\": {\n                                                                    \"type\": \"object\",\n                                                                    \"properties\": {\n                                                                        \"title\": {\n                                                                            \"type\": \"string\"\n                                                                        },\n                                                                        \"x-ms-dynamically-added\": {\n                                                                            \"type\": \"boolean\"\n                                                                        },\n                                                                        \"type\": {\n                                                                            \"type\": \"string\"\n                                                                        }\n                                                                    }\n                                                                }\n                                                            }\n                                                        }\n                                                    }\n                                                }\n                                            }\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n                },\n                \"templateName\": {\n                    \"type\": \"string\"\n                }\n            }\n        },\n        \"schemaVersion\": {\n            \"type\": \"string\"\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>Then to clean the output into a useable array. This will all be stored within a scope action\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-128.png\" alt=\"\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The Compose will remove all \u201c@\u201d from the output and replace it with a \u201cat\u201d. This is needed for when we convert it with xpath. \n\n<pre class=\"wp-block-code\"><code>replace(string(body('Parse_JSON_-_Client_Data')?&#91;'properties']?&#91;'definition']?&#91;'actions']), '@', 'at_')\n<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>The string is then converted into a JSON\n\n<pre class=\"wp-block-code\"><code>json(outputs('Compose_-_Clean_to_String'))<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>The output is then converted to an array\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-129.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>An for loop of each action is then added\n\n\n\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 Yes I know that this is a nested for loop, and thats not great. But sometimes is inevitable. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-132.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>xpath(xml(outputs('Compose_-_Create_Array')),'\/data\/*')<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 For a great read on xpath check out Tom Riha\u2019s blog. I could not have done it without it. \n\n<a href=\"https:\/\/tomriha.com\/how-to-extract-value-from-xml-using-power-automate-flow\/\">How to extract value from XML using Power Automate flow<\/a><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first step will check to see if the name is a default name\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-133.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-134.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>contains(variables('varDefaultNames'), xpath(item(), 'name(\/*)'))<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>The second increments the variable varDefaultNameCounter by 1\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-135.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-136.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>The next is a condition that checks if the output of the compare is true\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-137.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/image-138.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-3.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>If true or false two actions will occur\n<ol class=\"wp-block-list\">\n<li>If True the variable  varDefaultNameScores will be appended \n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-4.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"ProcessGUID\": @{items('Apply_to_each_-_Default_Names')?&#91;'ProcessGUID']},\n  \"ProcessName\": @{items('Apply_to_each_-_Default_Names')?&#91;'ProcessName']},\n  \"Action\": @{xpath(item(),'name(\/*)')},\n  \"DefaultNameScore\": @{outputs('List_rows_-_Get_Default_Name_Rules')?&#91;'body\/value']?&#91;0]?&#91;'ScoreOutput.andy_rating']}\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>If True the variable  varDefaultNameScore will be incremented\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-5.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>outputs('List_rows_-_Get_Default_Name_Rules')?&#91;'body\/value']?&#91;0]?&#91;'ScoreOutput.andy_rating']<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>If False the variable  varDefaultNameScores will be appended \n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-6.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"ProcessGUID\": @{items('Apply_to_each_-_Default_Names')?&#91;'ProcessGUID']},\n  \"ProcessName\": @{items('Apply_to_each_-_Default_Names')?&#91;'ProcessName']},\n  \"Action\": @{xpath(item(),'name(\/*)')},\n  \"DefaultNameScore\": 1\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>If False the variable  varDefaultNameScore will be incremented\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-7.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>Finally the flow will be closed out with a response\n\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-8.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>div(variables('varDefaultNameScore'), variables('varDefaultNameCounter'))<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>string(variables('varDefaultNameScores'))<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n<\/ol>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">1.2 - When a push to test happens flow updates<\/h1>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Back in the parent flow that was built in the previous post, add the 1.2.2 flow to run alongside the 1.2.1 flow.\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-9.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-10.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Two actions are added. A new variable varFlowDesctiptionsArray is added and a scope to format the output\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-11.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-12.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Within the scope are two other scopes \n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-13.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>The Scope Descriptions will have three Actions in it\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-14.png\" alt=\"\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The Parse JSON will parse the description output\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-15.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"type\": \"array\",\n    \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n            \"ProcessGUID\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"@@odata.type\": {\n                        \"type\": \"string\"\n                    },\n                    \"@@odata.id\": {\n                        \"type\": \"string\"\n                    },\n                    \"@@odata.etag\": {\n                        \"type\": \"string\"\n                    },\n                    \"@@odata.editLink\": {\n                        \"type\": \"string\"\n                    },\n                    \"objectid@odata.type\": {\n                        \"type\": \"string\"\n                    },\n                    \"objectid\": {\n                        \"type\": \"string\"\n                    },\n                    \"solutioncomponentid@odata.type\": {\n                        \"type\": \"string\"\n                    },\n                    \"solutioncomponentid\": {\n                        \"type\": \"string\"\n                    }\n                }\n            },\n            \"ProcessName\": {\n                \"type\": \"string\"\n            },\n            \"ProcessDescription\": {},\n            \"DescriptionScore\": {\n                \"type\": \"number\"\n            }\n        },\n        \"required\": &#91;\n            \"ProcessGUID\",\n            \"ProcessName\",\n            \"ProcessDescription\",\n            \"DescriptionScore\"\n        ]\n    }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>For each description the variable varFlowDesctiptionsArray is appeneded\n\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-16.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-17.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-18.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>if(empty(item()?&#91;'ProcessDescription']), 'Description Missing', item()?&#91;'ProcessDescription'])\n<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>An HTML table is then created usign the variable varFlowDesctiptionsArray\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-19.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-20.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>The Default Names Scope will have three actions\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-21.png\" alt=\"\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The Compose will create the JSON out of the output\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-22.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>json()body('Run_a_Child_Flow_-_1.2.2')?&#91;'defaultnamedescriptions'])<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>The Select will create the table structure\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-23.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"type\": \"Select\",\n  \"inputs\": {\n    \"from\": \"\",\n    \"select\": \"{n  \"Flow Name\": ,n  \"Action Name\": ,n  \"Action Score\": n}\"\n  },\n  \"runAfter\": {\n    \"Compose_-_Create_JSON\": &#91;\n      \"SUCCEEDED\"\n    ]\n  },\n  \"metadata\": {\n    \"operationMetadataId\": \"43e873e4-512d-4890-b495-a4eac9d66236\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>The Create HTML table will create the actual HTML table from the output of the select\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-24.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>These updates are then all added to the history table within production<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-25.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"type\": \"OpenApiConnection\",\n  \"inputs\": {\n    \"parameters\": {\n      \"organization\": \"https:\/\/andworx-production.crm.dynamics.com\",\n      \"entityName\": \"andy_powerplatformsolutionshistories\",\n      \"item\/andy_solutionversion\": \"@outputs('Get_a_row_by_ID_-_Deployment_Artifacts')?&#91;'body\/artifactversion']\",\n      \"item\/andy_appreviewscore\": \"@body('Run_a_Child_Flow_-_1.2.1')?&#91;'appreviewscore']\",\n      \"item\/andy_automatedefaultnamearrayoutput\": \"@body('Run_a_Child_Flow_-_1.2.2')?&#91;'defaultnamedescriptions']\",\n      \"item\/andy_automatedefaultnamescore\": \"@body('Run_a_Child_Flow_-_1.2.2')?&#91;'defaultnamescore']\",\n      \"item\/andy_automatedefaultnametableoutput\": \"@body('Create_HTML_table_-_Default_Names')\",\n      \"item\/andy_automatedescriptionscore\": \"@body('Run_a_Child_Flow_-_1.2.2')?&#91;'descriptionscore']\",\n      \"item\/andy_flowdescriptionsarrayoutput\": \"@body('Run_a_Child_Flow_-_1.2.2')?&#91;'defaultnamedescriptions']\",\n      \"item\/andy_flowdescriptionstableoutput\": \"@body('Create_HTML_table_-_varFlowDesctiptionsArray')\",\n      \"item\/andy_linktoreport\": \"https:\/\/apps.powerapps.com\/play\/@{parameters('Power Apps Review App ID (andy_PowerAppsReviewAppID)')}?reviewid=@{body('Run_a_Child_Flow_-_1.2.1')?&#91;'solutionreview']}\",\n      \"item\/andy_Solution@odata.bind\": \"andy_powerplatformsolutionstrackings(@{outputs('List_rows_from_selected_environment_-_Solution_Tracking')?&#91;'body\/value']?&#91;0]?&#91;'andy_powerplatformsolutionstrackingid']})\"\n    },\n    \"host\": {\n      \"apiId\": \"\/providers\/Microsoft.PowerApps\/apis\/shared_commondataserviceforapps\",\n      \"connection\": \"shared_commondataserviceforapps\",\n      \"operationId\": \"CreateRecordWithOrganization\"\n    }\n  },\n  \"runAfter\": {\n    \"List_rows_from_selected_environment_-_Solution_Tracking\": &#91;\n      \"Succeeded\"\n    ]\n  },\n  \"metadata\": {\n    \"operationMetadataId\": \"4cbf99ac-60fd-4696-ac0d-f7c112f48930\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Final Report<\/h1>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">Putting it all together will give us a snapshot into how our solution currently looks<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-26-1024x345.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-27-1024x500.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 The tables are built using a bit of JavaScript and a iframe from the html table created earlier<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/12\/image-28-1024x510.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-background\" style=\"background-color:rgb(241, 241, 239)\">\ud83d\udca1 The app is loaded using an iframe and JavaScript from the link that was created earlier<\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:rgb(0, 0, 0)\">&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous post, I integrated a power apps code review tool with Power Platform Pipelines. The tool that the Power CAT team had built was amazing and gave me some ideas on how I could handle doing reviews of Power Automate flows. &nbsp; Building off of the last process, I have added three flows. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1258,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,30,42,45],"tags":[],"class_list":["post-1335","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dataverse","category-power-automate","category-power-pipelines","category-pppm","entry","has-media"],"jetpack_featured_media_url":"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/11\/photo-1476610182048-b716b8518aae-scaled.jpg","_links":{"self":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts\/1335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/comments?post=1335"}],"version-history":[{"count":1,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts\/1335\/revisions"}],"predecessor-version":[{"id":1337,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts\/1335\/revisions\/1337"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/media\/1258"}],"wp:attachment":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/media?parent=1335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/categories?post=1335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/tags?post=1335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}