<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Power Automate on Hat Full of Data</title><link>https://hatfullofdata.blog/categories/power-automate/</link><description>Recent content in Power Automate on Hat Full of Data</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><lastBuildDate>Wed, 04 Jun 2025 13:25:02 +0000</lastBuildDate><atom:link href="https://hatfullofdata.blog/categories/power-automate/index.xml" rel="self" type="application/rss+xml"/><item><title>Trigger Microsoft Fabric Data Pipeline using Power Automate</title><link>https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/</link><pubDate>Sun, 06 Oct 2024 14:18:24 +0000</pubDate><guid>https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/</guid><description>&lt;img src="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/cover.png" alt="Featured image of post Trigger Microsoft Fabric Data Pipeline using Power Automate" /&gt;&lt;p&gt;Microsoft Fabric Data Pipelines can be scheduled to happen at regular times. What happens when you want trigger Microsoft Fabric data pipelines to run as a reaction to an event? For example someone pressing a button in an app. For this we can use Power Automate to start a pipeline using a http request.&lt;/p&gt;
&lt;h2 id="fixed"&gt;Fixed
&lt;/h2&gt;&lt;p&gt;This post has incorrect details for the connector. These have now been fixed.&lt;/p&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;&lt;a class="link" href="https://youtu.be/9-aNXqDQaZE" target="_blank" rel="noopener"
 &gt;&lt;img class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="383" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/Power-Automate-Trigger-Microsoft-Fabric-Data-Pipeline-Time-0_00_0000.png" width="680"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="workspace-and-pipeline-guids"&gt;Workspace and Pipeline GUIDs
&lt;/h2&gt;&lt;p&gt;The flow is going to use a http action that uses a URL that includes GUIDs for both the workspace and the data pipeline. Open the data pipeline that will be triggered. Look at the URL in the browser. The Workspace GUID is the string after /groups/ and the data pipeline GUID is the string after /pipelines/.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen shot of the data pipeline opened n a browser with highlights around the 2 GUIDs." class="gallery-image" data-flex-basis="712px" data-flex-grow="296" height="229" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/image-10.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="start-flow-and-add-variables"&gt;Start Flow and Add Variables
&lt;/h2&gt;&lt;p&gt;Now we have the required GUIDS we can start writing the flow. For this example we are going to use a manually triggered flow. Then we add an actions to initialise variables WorkspaceID and PipelineID and select Type of string and put in the values from the previous step.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Flow with a trigger of Manually trigger a flow and 2 Initialize variables for WorkspaceID and PipelineID, with the former selected and showing parameters." class="gallery-image" data-flex-basis="602px" data-flex-grow="250" height="271" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/image-11.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="url-of-the-trigger-microsoft-fabric-data-pipeline-request"&gt;URL of the Trigger Microsoft Fabric Data Pipeline request
&lt;/h2&gt;&lt;p&gt;Next I recommend you use a compose step to calculate the URL for the HTTP call. Interestingly the api uses workspaces rather than groups. Make sure you have the corrects /s and no spaces between. If you have called your variables WorkspaceID and PipelineID you can just copy the code below into a Compose action.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://api.fabric.microsoft.com/v1/workspaces/@{variables(&amp;#39;WorkspaceID&amp;#39;)}/items/@{variables(&amp;#39;PipelineID&amp;#39;)}/jobs/instances?jobType=Pipeline
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img alt="Compose step containing the above code" class="gallery-image" data-flex-basis="911px" data-flex-grow="379" height="179" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/image-14.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The above url including all the flags is documented by Microsoft here – &lt;a class="link" href="https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api#run-on-demand-item-job?wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api#run-on-demand-item-job&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="http-request"&gt;HTTP Request
&lt;/h2&gt;&lt;p&gt;For this action we are going to use HTTP with Microsoft Entra ID (preauthorized) connection’s Invoke an HTTP request action. Search for HTTP and scroll down till you find it.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Adding the connection details for the HTTP action" class="gallery-image" data-flex-basis="715px" data-flex-grow="298" height="228" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/image-18.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;If this is the first time you’ve used this action you will need to setup the connection to connect to this api you will need to set it up. The two urls required are below, sometimes they appear the other way around.&lt;/p&gt;
&lt;h4 id="base-resource-url"&gt;Base Resource URL
&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://api.fabric.microsoft.com/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h4 id="microsoft-entra-id-resource-uri"&gt;Microsoft Entra ID Resource URI
&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://analysis.windows.net/powerbi/api
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Once you have the connection sorted you can enter in the details of the request. The Method is POST and the Url of the request is the output from the compose step.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Invoke an HTTP request action" class="gallery-image" data-flex-basis="750px" data-flex-grow="312" height="217" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/image-15.png" width="679"&gt;&lt;/p&gt;
&lt;h2 id="testing-trigger-microsoft-fabric-data-pipeline-flow"&gt;Testing Trigger Microsoft Fabric Data Pipeline Flow
&lt;/h2&gt;&lt;p&gt;The flow requires no inputs so can just be run. When the flow runs it appears to fail, but if you check the data pipeline run history you will see it was triggered just fine.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Test to Trigger Microsoft Fabric Data Pipeline" class="gallery-image" data-flex-basis="461px" data-flex-grow="192" height="354" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/image-17.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;If you look in the documentation found at &lt;a class="link" href="https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api#run-on-demand-item-job" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api#run-on-demand-item-job&lt;/a&gt;. There is a note that says “There is no body returned currently”. Eventually it will return the job id of the pipeline run, so I am guessing because that is not returned Power Automate assumes it failed.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;Data pipelines are the orchestration tool of Microsoft Fabric so being able to connect it to the Power Platform orchestration tool makes perfect sense. I look forward to the day I can mark this post as redundant and there is a Power Automate connector with an obvious action for this.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Automate – Save a File to OneLake Lakehouse</title><link>https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/</link><pubDate>Thu, 03 Oct 2024 14:48:09 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/cover.png" alt="Featured image of post Power Automate – Save a File to OneLake Lakehouse" /&gt;&lt;p&gt;Currently there is no Microsoft Fabric connector in Power Automate. When we want Power Automate to save a file to OneLake Lakehouse, we need to use a workaround. This post walks through the demo I did for the Microsoft Fabric European Conference 2024. You need to be aware that this uses a premium connector!&lt;/p&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;&lt;img alt="YouTube thumbnail" class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="383" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/Power-Automate-Copy-File-from-SharePoint-to-Lakehouse-Time-0_00_0000.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="getting-the-file-content"&gt;Getting the File Content
&lt;/h2&gt;&lt;p&gt;Before we can save a file anywhere we need the file content we are going to save. For this post I am going to work with the flow triggering from a new file in a SharePoint library and getting the file content action.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The trigger showing When a file is created and an action of Get file content" class="gallery-image" data-flex-basis="562px" data-flex-grow="234" height="290" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/image.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;From the SharePoint connector triggers, select the When a file is created (properties only) and populate the site address and library name. Next add a SharePoint action, Get file content. Populate the Site Address same as the trigger. For the File Identifier, select Identifier from the dynamic content from the trigger.&lt;/p&gt;
&lt;h2 id="lakehouse-folder-url"&gt;Lakehouse Folder URL
&lt;/h2&gt;&lt;p&gt;Next we need to know the url of the Lakehouse folder where we want the file to go. This can be found in the Lakehouse by clicking on the three dots next to the required folder and from the menu selecting properties. This will open the properties pane on the right hand side. Click the copy button next to the URL.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Lakehouse folder menu with Properties highlighted and the Properties pane with URL copy button highlighted" class="gallery-image" data-flex-basis="630px" data-flex-grow="262" height="259" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/image-1.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;To make life easy for ourselves we put this into a compose step followed by name of the file that triggered the flow. This is in the dynamic content from the trigger and is called File name with extension. Please note there is a / before the file name.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Compose step with the URL pasted in followed by the dynamic value from the trigger of File name with extension" class="gallery-image" data-flex-basis="597px" data-flex-grow="249" height="273" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/image-2.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="create-the-file-in-the-lakehouse"&gt;Create the file in the LakeHouse
&lt;/h2&gt;&lt;h3 id="set-up-the-connection"&gt;Set up the connection
&lt;/h3&gt;&lt;p&gt;We are going to use the HTTP with Microsoft Entra ID (preauthorised) action to interact with the Lakehouse to create the file. When you add the new action search for http and then scroll down to find the right action.&lt;/p&gt;
&lt;p&gt;&lt;img alt="search and select http to save a file to onelake lakehouse" class="gallery-image" data-flex-basis="680px" data-flex-grow="283" height="240" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/image-3.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;If this is the first time you’ve used this action you will need to set-up the connection. Also if this is the first time you’ve connected to the Lakehouse in this way you need to setup a new connection. It asks for two URLS. Once connected you are ready to save a File to OneLake Lakehouse&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://onelake.dfs.fabric.microsoft.com/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://storage.azure.com/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="create-blank-file"&gt;Create Blank File
&lt;/h3&gt;&lt;p&gt;The first stage is to save a file to OneLake Lakehouse that is empty. This is a simple PUT action with a parameter of ?resource=file after the path created in the compose. So select PUT for the method. In the URL of the request but the Output from the compose and add on ?resource=file. I also renamed the action.&lt;/p&gt;
&lt;p&gt;&lt;img alt="HTTP" class="gallery-image" data-flex-basis="521px" data-flex-grow="217" height="313" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/image-5.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="append-content"&gt;Append Content
&lt;/h3&gt;&lt;p&gt;Finally the last action is to append the file content from SharePoint onto the file. Change the Method to PATCH. The Url of the request is the output from the compose followed by three parameters (copy from below). Expand the Advanced parameters and into the body of the request select File Content from the dynamic content.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="437px" data-flex-grow="182" height="373" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/image-7.png" width="680"&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;?action=append&lt;span class="err"&gt;&amp;amp;&lt;/span&gt;position=0&lt;span class="err"&gt;&amp;amp;&lt;/span&gt;flush=true
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id="test-save-a-file-to-onelake-lakehouse"&gt;Test Save a File to OneLake Lakehouse
&lt;/h2&gt;&lt;p&gt;Save your flow and add a file to your SharePoint library and wait a minute or 2 for the flow to trigger. A file should appear in your Lake House.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen shot of green success tips against all the actions in the flow and the file in SharePoint and the file in the Lakehouse" class="gallery-image" data-flex-basis="297px" data-flex-grow="124" height="548" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/image-8.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;There are plenty of business cases of use cases to be able to store a file into OneLake. Various legacy systems email daily exports which will need to be saved and processed in the LakeHouse. When / If we get a Fabric connector I look forward to making this post as redundant!&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>DevOps updates on behalf of another with Power Automate</title><link>https://hatfullofdata.blog/devops-updates-on-behalf-of-another/</link><pubDate>Mon, 19 Aug 2024 09:34:27 +0000</pubDate><guid>https://hatfullofdata.blog/devops-updates-on-behalf-of-another/</guid><description>&lt;img src="https://hatfullofdata.blog/devops-updates-on-behalf-of-another/cover.png" alt="Featured image of post DevOps updates on behalf of another with Power Automate" /&gt;&lt;p&gt;I had a need to use automation to do DevOps updates on behalf of another person so when the DevOps adoption metrics were done we the stats were slightly more accurate. This can only be done using REST API and will need permissions. This post is part of the DevOps and Power Automate series.&lt;/p&gt;
&lt;h2 id="devops-with-power-automate-posts"&gt;DevOps with Power Automate posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Connecting Power Automate to Azure DevOps&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/" target="_blank" rel="noopener"
 &gt;Updating Start and Due dates and other fields&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/" target="_blank" rel="noopener"
 &gt;Using DevOps Rest API&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/" target="_blank" rel="noopener"
 &gt;Running a WIQL query&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/update-devops-without-notifications-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating items without Notifications&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-updates-on-behalf-of-another-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating a task on behalf of another person&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;It’s on the backlog!&lt;/p&gt;
&lt;h2 id="permission-required-to-makes-updates-on-behalf-of-another"&gt;Permission required to makes updates on behalf of another
&lt;/h2&gt;&lt;p&gt;The trick to being able update on behalf of another is to update the ChangedBy field to another persons email address. This is not normally allowed, it breaks the rules. So the permission we need is to bypass the rules and make illegal updates.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Setting up permissions in project settings to allow for updates on behalf of another" class="gallery-image" data-flex-basis="1095px" data-flex-grow="456" height="149" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/devops-updates-on-behalf-of-another/2024-08-19_09-31-25.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Permissions are managed in Project Settings, you then click on permissions. Click on Users at the top and then click on the user being used in the flow to show their permissions. Under Boards check the permission for Bypass rules on work item updates. This needs to be set to Allow.&lt;/p&gt;
&lt;h2 id="make-updates-on-behalf-of-another"&gt;Make Updates on behalf of another
&lt;/h2&gt;&lt;p&gt;Now we have permission is ignore the rules we can test out a flow. In the REST API documentation for updating an item &lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update?wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update&lt;/a&gt; you will see there is a boolean parameter bypassRules. This can be added to the relative URI using &amp;amp; to separate the parameters.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Send an HTTP request to Azure DevOps action with the bypassRules flag added to the URI and in the Body JSON an extra section to update the ChangedBy field. See Code below." class="gallery-image" data-flex-basis="236px" data-flex-grow="98" height="689" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/devops-updates-on-behalf-of-another/2024-08-19_09-53-45.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;In the body section I have added an update to the ChangedBy field. This update updates the State to active and performs it on behalf of Dan. In the task history we can see the update and see I did it on behalf of Dan.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Work item history showing the line Dan Cooke (via Laura Graham-Brown) changed State from New to Active" class="gallery-image" data-flex-basis="352px" data-flex-grow="146" height="463" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/devops-updates-on-behalf-of-another/2024-08-19_10-02-21-1.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="word-of-caution"&gt;Word of caution
&lt;/h2&gt;&lt;p&gt;By passing the rules, it also means that the updates behind the scenes that happen are turned off. If we change the state to closed using the same technique the we get an error when we open the work item.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Send an HPPP request to Azure DevOps action with bypassRules=true and changing the state to Closed. Plus a screen shot of the updated task opened and showing an error of Field Closed Date cannot be empty." class="gallery-image" data-flex-basis="473px" data-flex-grow="197" height="345" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/devops-updates-on-behalf-of-another/2024-08-19_10-11-52.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;So make sure you have checked the updates you are doing and include all the fields you need to update, even the hidden ones.&lt;/p&gt;
&lt;p&gt;Second word of warning is no checks are done on the updates. So you can assign a task to an email address that doesn’t have access, or update to a state that is not valid. So treat this one with caution.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;Updates on behalf of another is a very powerful trick. But should be treated with extra caution and it has made me double check permissions on a ew projects so access to by passing the rules is limited.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Update DevOps without Notifications with Power Automate</title><link>https://hatfullofdata.blog/update-devops-without-notifications/</link><pubDate>Fri, 16 Aug 2024 07:52:49 +0000</pubDate><guid>https://hatfullofdata.blog/update-devops-without-notifications/</guid><description>&lt;img src="https://hatfullofdata.blog/update-devops-without-notifications/cover.png" alt="Featured image of post Update DevOps without Notifications with Power Automate" /&gt;&lt;p&gt;When a work item is assigned to you, by default you are sent a notification. Notifications can also be sent regarding updates to your items. Now imagine creating over 10 thousand tasks automatically and assigning them to people. I recently did this on a projects and potentially each person was going to get 100s of emails. So I needed Power Automate to assign the tasks without notifications. This post is part of the Power Automate and DevOps series.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Email telling you a work item has been assigned to you" class="gallery-image" data-flex-basis="370px" data-flex-grow="154" height="440" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/update-devops-without-notifications/2024-08-14_13-49-44.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="devops-with-power-automate-posts"&gt;DevOps with Power Automate posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Connecting Power Automate to Azure DevOps&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/" target="_blank" rel="noopener"
 &gt;Updating Start and Due dates and other fields&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/" target="_blank" rel="noopener"
 &gt;Using DevOps Rest API&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/" target="_blank" rel="noopener"
 &gt;Running a WIQL query&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/update-devops-without-notifications-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating items without Notifications&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-updates-on-behalf-of-another-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating a task on behalf of another person&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;They are on the backlog!&lt;/p&gt;
&lt;h2 id="permissions-for-updates-without-notifications"&gt;Permissions for updates without notifications
&lt;/h2&gt;&lt;p&gt;Updating DevOps without notifications is not something that everyone should be able to do. Or at least the admins will want to be able to control who can do it.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="922px" data-flex-grow="384" height="177" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/update-devops-without-notifications/2024-08-14_14-06-11.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;In the Project settings, click on Permissions. Then click on Users to list your users. When you click on a person you get to see all their permissions. They can be Allow, Deny or Not Set for all the different actions. (inherited) means it is set by being a member of a group. If you hover your cursor over the (i) you will get a description telling you which membership the permission as inherited from. A Deny overrides an allow, so you might need to manually override the inherited permission.&lt;/p&gt;
&lt;p&gt;The permission we are interested in is Suppress notifications for work item updates.&lt;/p&gt;
&lt;h2 id="updating-without-notifications"&gt;Updating without Notifications
&lt;/h2&gt;&lt;p&gt;Now we have the permission we can test it out in an update. This can only be done on updates done by a REST API call. If you look on &lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update?" target="_blank" rel="noopener"
 &gt;https://learn.&lt;/a&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update?wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update&lt;/a&gt; there is a URI parameter suppressNotifications which is a boolean.&lt;/p&gt;
&lt;p&gt;URI parameters get added after the ? and are separated by &amp;amp;. So the code to update item 36 without notifications would be&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{project}/_apis/wit/workitems/36?suppressNotifications=true&lt;span class="err"&gt;&amp;amp;&lt;/span&gt;api-version=7.0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img alt="A send HTTO request to DevOps action with the suppressNotifications parameter added." class="gallery-image" data-flex-basis="292px" data-flex-grow="122" height="557" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/update-devops-without-notifications/2024-08-14_14-40-32-1.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="item-history"&gt;Item History
&lt;/h2&gt;&lt;p&gt;Suppressing the notifications does prevent automated updates filling inboxes with emails that will just get deleted. It does not however supress the history of the item being updated. So who did the update and when is still recorded.&lt;/p&gt;
&lt;p&gt;&lt;img alt="History of a work item showing the updates" class="gallery-image" data-flex-basis="502px" data-flex-grow="209" height="325" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/update-devops-without-notifications/2024-08-14_14-45-14.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Running a Wiql DevOps query in Power Automate</title><link>https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/</link><pubDate>Wed, 14 Aug 2024 11:55:17 +0000</pubDate><guid>https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/</guid><description>&lt;img src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/cover.png" alt="Featured image of post Running a Wiql DevOps query in Power Automate" /&gt;&lt;p&gt;Wiql stands for Work Item Query Language and is the language used to define the queries in Azure DevOps. Its has a very similar syntax to SQL. Power Automate can use a REST API send a query to DevOps to execute the query. This post post is part of the Power Automate and DevOps series.&lt;/p&gt;
&lt;h2 id="devops-with-power-automate-posts"&gt;DevOps with Power Automate posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Connecting Power Automate to Azure DevOps&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/" target="_blank" rel="noopener"
 &gt;Updating Start and Due dates and other fields&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/" target="_blank" rel="noopener"
 &gt;Using DevOps Rest API&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/" target="_blank" rel="noopener"
 &gt;Running a WIQL query&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/update-devops-without-notifications-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating items without Notifications&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-updates-on-behalf-of-another-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating a task on behalf of another person&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The full reference can be found at &lt;a class="link" href="https://learn.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops&amp;amp;wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="writing-the-query"&gt;Writing the Query
&lt;/h2&gt;&lt;p&gt;You can write it by hand, and I’m sure some people do. I use the query tools in DevOps to build the query and then view the Wiql code. For this post the example we are going to is to assign all the items in a hierarchy to one person. For example all the items in the Design Shiny feature.&lt;/p&gt;
&lt;p&gt;&lt;img alt="List of items including a feature called Design Shiny that has 2 user stories and they have multiple tasks." class="gallery-image" data-flex-basis="372px" data-flex-grow="155" height="438" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-13_17-54-33.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="wiql-editor"&gt;Wiql Editor
&lt;/h3&gt;&lt;p&gt;Before we can work with WIQL we need to install the extension Wiql Playground in the organisation. You will need to be an organisation admin to do this. Head to the marketplace for Visual Studio, found here&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://marketplace.visualstudio.com/azuredevops" target="_blank" rel="noopener"
 &gt;Extensions for Visual Studio family of products | Visual Studio Marketplace&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Search for wiql and click on the Wiql Editor. When the extension information page opens click on Get it free. Then on the next page, select the right organisation and click Download. It will now appear under boards in your project.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grab of the market place showing the results of searching for wiql and then the header of the Wiql editor page showing the Get it free button. Then the select an organisation page with a download button and finally the Boards side menu showing Wiql Playground listed" class="gallery-image" data-flex-basis="377px" data-flex-grow="157" height="432" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-13_18-12-57.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="construct-query"&gt;Construct Query
&lt;/h3&gt;&lt;p&gt;Now in Queries construct the query. I am not here to teach you building queries in DevOps, there is a great post to get you started here &lt;a class="link" href="https://learn.microsoft.com/en-us/azure/devops/boards/queries/using-queries?wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/azure/devops/boards/queries/using-queries&lt;/a&gt;. My query is a tree of work items, matching the top item first and only has 2 criteria of the top item is ID 17 and the child item is not closed or completed.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Showing how to get to the wiql of a query in DevOps" class="gallery-image" data-flex-basis="353px" data-flex-grow="147" height="462" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-14_08-57-50.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Once you have your query working and you have saved it you can view the Wiql. Click on the three dots in the top right. Then from the menu select Edit query wiql. This will open a pane containing the code that you can copy to your clipboard.&lt;/p&gt;
&lt;p&gt;Note you have to save after any changes for the changes to be in the Wiql code.&lt;/p&gt;
&lt;h2 id="running-the-wiql-in-power-automate"&gt;Running the Wiql in Power Automate
&lt;/h2&gt;&lt;p&gt;Now we have the Wiql code we can write the flow. The flow will have the parameters of the Parent Work Item ID and the email address to assign all the tasks to. We will then use a compose action to the Parent Work Item ID and Project name into the Wiql.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen shot of the flow with a manual trigger with a Parent Work Item ID as a parameter. Then a compose action with the Wiql code with the Project name environment variable and the Parent Work Item ID in the code" class="gallery-image" data-flex-basis="159px" data-flex-grow="66" height="1021" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-14_09-20-21.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The next step is to run the query. The documentation for the REST API call can be found here &lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/wiql/query-by-wiql?wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/wiql/query-by-wiql&lt;/a&gt; The method is Post and the URI will be the same for all Wiql&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;_apis/wit/wiql?api-version=7.1-preview.2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The body is JSON with only one field query with the output from the compose action.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Send an HTTP request to Azure DevOps action with a Method of POST, the URI as above and the Body containing { “query” : “Compose Output” }" class="gallery-image" data-flex-basis="415px" data-flex-grow="173" height="393" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-14_09-42-46.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When we run the flow and enter in the Parent ID 17 and the email &lt;a class="link" href="mailto:Dan@lgb123.onmicrosoft.com" &gt;Dan@lgb123.onmicrosoft.com&lt;/a&gt; it executes and returns us the data.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The Run flow dialog with the 2 parameters populated and then the HTTP action successfully run showing the JSON Output of the wiql query" class="gallery-image" data-flex-basis="273px" data-flex-grow="113" height="597" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-14_09-46-52.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="handling-the-output-of-the-http-call"&gt;Handling the Output of the HTTP call
&lt;/h2&gt;&lt;p&gt;In the successful action we can click on Show raw output in the Outputs section to open a pane and explore the Json output. Scroll past the headers and then in the body section, past columns to find workItemRelations. This will list all the work items returned by the query, not their details, just the id and url in the target section.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The output code with workItemRelations and Target with Id highlighted" class="gallery-image" data-flex-basis="164px" data-flex-grow="68" height="990" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-14_11-53-29.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;To make this easy to work with we need to use a Parse JSON so copy all the output JSON and return to editing the flow. Add a Parse JSON step and add the Body returned by the HTTP to the Content. Next we need to add a schema, this can be generated. Click on Generate from sample. Then paste in the JSON you copied and click Done. And a schema will be added.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A parse json action showing the content and how to generate the schema" class="gallery-image" data-flex-basis="213px" data-flex-grow="88" height="766" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-14_11-45-40.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The output schema is now known to the flow. So we can use the output to loop through all the items and update the work items.&lt;/p&gt;
&lt;h2 id="looping-through-workitemrelations"&gt;Looping through workItemRelations
&lt;/h2&gt;&lt;p&gt;We can loop through the workItemRelations using an Apply to each action. The piece of information I want from each item is the target – id. So I add a compose and add the following expression&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;item()?[&amp;#39;target&amp;#39;]?[&amp;#39;id&amp;#39;]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;I would then test to make sure you get the number of items you expect and that the compose does return the ids you expect&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="593px" data-flex-grow="247" height="275" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-14_12-32-25.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Finally we can add a step to assign each task to the email given in the parameter. I use a Send HTTP method rather than the Update a Work Item so I can as explained in a future post turn off notifications.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Added a send HTTP request to Azure DevOps to assign the task id from the compose step to the email " class="gallery-image" data-flex-basis="187px" data-flex-grow="78" height="869" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/image.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;We can then run the flow and check the results in DevOps and see the tasks have been assigned.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="540px" data-flex-grow="225" height="302" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/2024-08-14_12-45-23.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;this was one example of using Wiql inside Power Automate. I have used it to duplicate hierarchies and delete a hierarchy. The skill comes in being able to write the Wiql to achieve what you need.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Using DevOps REST API in Power Automate</title><link>https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/</link><pubDate>Tue, 13 Aug 2024 16:37:38 +0000</pubDate><guid>https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/</guid><description>&lt;img src="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/cover.png" alt="Featured image of post Using DevOps REST API in Power Automate" /&gt;&lt;p&gt;DevOps REST API is a well documented API that we can easily use in Power Automate to perform a huge range of actions. The connector includes an action to make it easy. The API documentation can be found at&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/azure/devops?wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/azure/devops&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this post we will take some simple examples to get you started. This is the third post in the DevOps and Power Automate series.&lt;/p&gt;
&lt;h2 id="devops-with-power-automate-posts"&gt;DevOps with Power Automate posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Connecting Power Automate to Azure DevOps&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/" target="_blank" rel="noopener"
 &gt;Updating Start and Due dates and other fields&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/" target="_blank" rel="noopener"
 &gt;Using DevOps Rest API&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/" target="_blank" rel="noopener"
 &gt;Running a WIQL query&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/update-devops-without-notifications-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating items without Notifications&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-updates-on-behalf-of-another-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating a task on behalf of another person&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;Its coming honest!&lt;/p&gt;
&lt;h2 id="get-task-details-using-devops-rest-api"&gt;Get Task Details using DevOps REST API
&lt;/h2&gt;&lt;p&gt;Power Automate includes an action to get the details of a Work Item. When we look we can see it has 4 required fields. Organization name, Project Name and Work Item Id are easy. We will have them. I had problems with Work Item Type, I didn’t always have that. So I looked to DevOps REST API for an alternative.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Get Work item details action showing the 4 required parameters with Work Item Type highlighted" class="gallery-image" data-flex-basis="632px" data-flex-grow="263" height="258" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/2024-08-11_18-12-59.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;If we look in the documentation and then search for Get Work Item, you will find the syntax for fetching the details of one work item. The URL needs three pieces of information, shown in the {} brackets, organization, project and id. So no Work item type is required.&lt;/p&gt;
&lt;p&gt;&lt;img alt="screenshot of the HTTP statement in the API documentation. Code is below" class="gallery-image" data-flex-basis="1371px" data-flex-grow="571" height="119" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/2024-08-11_18-17-44.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/get-work-item?wt.mc_id=DX-MVP-5003563" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/get-work-item&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We start with an instant flow. Then we add the a parameter to the trigger of the work item id. Then we add the action Send an HTTP request to Azure DevOps. The Organisation we can use our environment variable (or from the drop down). The method is GET. The Relative URI is everything after the organisation in the url we got from the documentation.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{project}/_apis/wit/workitems/{id}?api-version=7.2-preview.3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img alt="Manual trigger in a flow with a Work Item ID as a parameter followed by an action of Send an HTTP request to Azure DevOps" class="gallery-image" data-flex-basis="275px" data-flex-grow="114" height="593" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/2024-08-11_18-29-38.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When we run the flow, we get prompted to enter the number of a work item id. When it completes, we get returned the JSON of that work item details. If you need to extract information from that JSON, you will probably need a Parse JSON action. (Another post!)&lt;/p&gt;
&lt;p&gt;&lt;img alt="The Rn flow requesting Work Item ID and the result action showing the body contains a JSON statement" class="gallery-image" data-flex-basis="346px" data-flex-grow="144" height="471" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/2024-08-11_18-29-12.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="update-a-work-item-using-devops-rest-api"&gt;Update a Work Item using DevOps REST API
&lt;/h2&gt;&lt;p&gt;We can update an item using the REST API. For this example the flow will update a given task to have the state Active and be assigned to the given email. So, we add Work Item ID and Email as two parameters to the trigger.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A flow with a Manual trigger showing 2 parameters Work Item ID and Email. An action of Send a HTTP request to Azure DevOps using a path method and updating the State and AssignedTo fields." class="gallery-image" data-flex-basis="164px" data-flex-grow="68" height="992" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/2024-08-12_16-34-04.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Then we add a Send an HTTP request to Azure DevOps action. The Organisation is the same as before, the method is now Patch as we are updating data. The Relative URI is exactly the same as before. In the headers we need to add Content-Type and application/json-patch+json&lt;/p&gt;
&lt;p&gt;In the Body we need to add a JSON object that includes the fields we want to update. For this we need to know the field names, see the previous post in the series for ways to find them. It is just text so we can insert dynamic content, e.g. the email address. The above example picture and code below shows changing the State to Active and assigning it to the Email address&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;op&amp;#34;: &amp;#34;add&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;path&amp;#34;: &amp;#34;/fields/System.State&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;value&amp;#34;: &amp;#34;Active&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;op&amp;#34;: &amp;#34;add&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;path&amp;#34;: &amp;#34;/fields/System.AssignedTo&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;value&amp;#34;: &amp;#34;@{triggerBody()[&amp;#39;text_1&amp;#39;]}&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;Rest API is a very powerful way to work with Azure DevOps and the action in Power Automate does make it very easy to use. It is worth having a test project to try out some of the options. Other posts will look at using Rest API to make changes without notifications and on behalf of another person. Also a bulk delete process, which needs a post of its own due to a few oddities.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Automate Update Fields in Azure DevOps</title><link>https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/</link><pubDate>Mon, 29 Jul 2024 08:09:46 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/cover.png" alt="Featured image of post Power Automate Update Fields in Azure DevOps" /&gt;&lt;p&gt;In a previous post we created items in DevOps. Although the Power Automate create item action had lots of fields, it did not have all the fields. This post shows you how to find the names for those fields and update fields in Azure DevOps using Power Automate.&lt;/p&gt;
&lt;h2 id="devops-with-power-automate-posts"&gt;DevOps with Power Automate posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Connecting Power Automate to Azure DevOps&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/" target="_blank" rel="noopener"
 &gt;Updating Start and Due dates and other fields&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/" target="_blank" rel="noopener"
 &gt;Using DevOps Rest API&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/" target="_blank" rel="noopener"
 &gt;Running a WIQL query&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/update-devops-without-notifications-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating items without Notifications&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-updates-on-behalf-of-another-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating a task on behalf of another person&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;Its coming 🙂&lt;/p&gt;
&lt;h2 id="the-problem"&gt;The Problem
&lt;/h2&gt;&lt;p&gt;If you compare the fields available in a standard Epic item in DevOps with the fields available in Power Automate create work item action you will notice some fields are missing. The obvious missing ones being Start Date and Target Date and other fields like Business Value etc and any custom fields you’ve added will not be there so we need to update fields in Azure DevOps.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grabs of an Epic work item in DevOps and the DevOps Create a work item Power Automate action" class="gallery-image" data-flex-basis="480px" data-flex-grow="200" height="340" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/2024-07-26_11-14-53-1.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The observant ones amongst you will have noticed the Other Fields option in the Power Automate action. It wants a key for your field which is the name of the field. And guess what that name is not going to be StartDate. So our first job is finding that name.&lt;/p&gt;
&lt;h2 id="finding-field-names-v1"&gt;Finding Field Names v1
&lt;/h2&gt;&lt;p&gt;This is the first method and I think the simplest method. Start by creating an item in DevOps that has values in the fields you would like the names of. I’ve populated Effort, Business Value, Time Criticality, Start Date and Target Date.&lt;/p&gt;
&lt;p&gt;&lt;img alt="DevOps Epic work item with fields populated" class="gallery-image" data-flex-basis="329px" data-flex-grow="137" height="496" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/2024-07-26_11-35-06.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Then in a Power Automate instant flow I add an action to get the work item details of that item, notice it is number 21. In the Get work item details I populate Org&lt;a class="link" href="#a040a142-03b1-4e20-a10b-8fe2427f8d11" &gt;1&lt;/a&gt;, Project, Type=”Epic” and Id=21. Then I run that flow and look at the outputs from that step.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="359px" data-flex-grow="149" height="454" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/2024-07-26_11-44-44.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;If you scroll through the fields you will eventually find Business Value etc with their full field names. You need to replace the _ with . as I assume JSON objects to dots in field names. Note down the ones you need.&lt;/p&gt;
&lt;h2 id="create-work-item-and-update-fields-in-azure-devops"&gt;Create Work Item and Update Fields in Azure DevOps
&lt;/h2&gt;&lt;p&gt;Now we have the field names we can create a work item and populate those fields. Note the date formats are YYYY-MM-DDThh:mm:ssZ.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="203px" data-flex-grow="84" height="801" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/2024-07-26_13-11-22.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When this flow is run, it creates an item and will successfully update fields in Azure DevOps.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="334px" data-flex-grow="139" height="488" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/2024-07-26_13-22-58.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The Update a work item action has exactly the same Other fields option so you can use the same technique.&lt;/p&gt;
&lt;h2 id="find-field-names-v2"&gt;Find Field Names v2
&lt;/h2&gt;&lt;p&gt;Azure DevOps can be accessed via a Rest API&lt;a class="link" href="#6ef2c091-087e-46c5-8e21-2bba1d5c5562" &gt;2&lt;/a&gt; and this includes the list of fields available in a project. There is quite good documentation for this which can be found at &lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/fields/list" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/fields/list&lt;/a&gt; . From the first code block on that post remove the GET and populate your org and project names. Then in a browser navigate to that url and it will return lots of JSON showing the definition of all the fields.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://dev.azure.com/{organization}/{project}/_apis/wit/fields
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="336px" data-flex-grow="140" height="485" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/2024-07-26_13-35-35.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Then search for the fields you want and look for the referenceName and use that. As my project got complex I saved this data and then used Power Query to make a simple list of fields (perhaps a resource I should make public).&lt;/p&gt;
&lt;h2 id="conclusion-on-update-fields-in-azure-devops"&gt;Conclusion on Update Fields in Azure DevOps
&lt;/h2&gt;&lt;p&gt;The Other Fields section in Create and Update work item actions gives us the option to update items however we want to. Some fields of course are read only and updating some fields will update other fields, for example if you change the state to Closed it will then populate the Closed date field.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="footnotes"&gt;Footnotes
&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;I’ve used environment variables to populate these as my flow is in a solution and I want to be able to move the solution to other environments or tenancies! &lt;a class="link" href="#a040a142-03b1-4e20-a10b-8fe2427f8d11-link" &gt;↩︎&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Another blog post is coming to cover using Azure DevOps Rest api in Power Automate, I promise! &lt;a class="link" href="#6ef2c091-087e-46c5-8e21-2bba1d5c5562-link" &gt;↩︎&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Connecting Power Automate to DevOps</title><link>https://hatfullofdata.blog/connecting-power-automate-to-devops/</link><pubDate>Thu, 25 Jul 2024 10:54:26 +0000</pubDate><guid>https://hatfullofdata.blog/connecting-power-automate-to-devops/</guid><description>&lt;img src="https://hatfullofdata.blog/connecting-power-automate-to-devops/cover.png" alt="Featured image of post Connecting Power Automate to DevOps" /&gt;&lt;p&gt;I know Azure DevOps from being on projects. Mostly for tracking tasks, sprints etc. I recently had to automate some item creation and editing across 1000s of tasks in DevOps. So I had to explore connecting Power Automate to DevOps for item creation and item editing. This is the first post I have in a long list of posts regarding DevOps with Power Automate and Power BI, welcome to my way of remembering how I did something.&lt;/p&gt;
&lt;h2 id="devops-with-power-automate-posts"&gt;DevOps with Power Automate posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Connecting Power Automate to Azure DevOps&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-update-fields-in-azure-devops/" target="_blank" rel="noopener"
 &gt;Updating Start and Due dates and other fields&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-devops-rest-api-in-power-automate/" target="_blank" rel="noopener"
 &gt;Using DevOps Rest API&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/running-a-wiql-devops-query-in-power-automate/" target="_blank" rel="noopener"
 &gt;Running a WIQL query&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/update-devops-without-notifications-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating items without Notifications&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-updates-on-behalf-of-another-with-power-automate/" target="_blank" rel="noopener"
 &gt;Updating a task on behalf of another person&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;&lt;a class="link" href="https://youtu.be/snZdRzfuNIo" target="_blank" rel="noopener"
 &gt;&lt;img class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="383" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/connecting-power-automate-to-devops/Power-Automate-Create-DevOps-Items-Time-0_00_0000.png" width="680"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="devops-connector"&gt;DevOps Connector
&lt;/h2&gt;&lt;p&gt;While editing a flow if you add action and search for DevOps you will find the Azure DevOps connector. If you look at the actions in the classic format&lt;a class="link" href="#65a785ed-7cea-41c5-b383-422365835ab1" &gt;1&lt;/a&gt; you will notice its a premium connector, i.e. you need a premium license. If you have not used this connector before it will prompt you to login. It assumes your DevOps login matches your Power Automate login.&lt;/p&gt;
&lt;p&gt;&lt;img alt="List of available actions for the DevOps connector which have the Premium label on and the dialog prompting you to Sign in if this is your first time using this connector." class="gallery-image" data-flex-basis="444px" data-flex-grow="185" height="367" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/connecting-power-automate-to-devops/2024-07-23_10-48-39.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="create-an-item"&gt;Create an item
&lt;/h2&gt;&lt;p&gt;Let’s start with a simple action to create a work item in a project. We start by adding the action Create a work item.&lt;/p&gt;
&lt;p&gt;The Organisation Name and the Project Name drop downs will contain the organisations and projects your login can see. (See further down about making this solution friendly). The Work Item Type drop down will contain all the types that the project allows from its process. The title is plain text and the Description is rich text, i.e. html.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Create a work item action dialog" class="gallery-image" data-flex-basis="438px" data-flex-grow="182" height="372" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/connecting-power-automate-to-devops/2024-07-23_10-55-59.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When you test the flow you should get a work item created that matches the above.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Flow with green ticks showing it completed and a screen grab of the Epic work item created by the flow." class="gallery-image" data-flex-basis="632px" data-flex-grow="263" height="258" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/connecting-power-automate-to-devops/2024-07-23_17-35-09.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="troubleshoot-connecting-power-automate-to-devops"&gt;Troubleshoot Connecting Power Automate to DevOps
&lt;/h2&gt;&lt;p&gt;If the flow fails with an error regarding authorisation, you need to first check you are allowed to add an item in that project in DevOps. Then you need to check the organisation settings in DevOps. Look in Policies and make sure Third-party application access via OAuth is turned on.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Flow run showing the failure and then a screen grab of Organisation settings of Policies with Third-party application access via OAuth highlighted to allow connecting Power Automate to DevOps" class="gallery-image" data-flex-basis="422px" data-flex-grow="176" height="386" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/connecting-power-automate-to-devops/2024-07-23_17-43-58.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="advanced-options-in-create-an-item"&gt;Advanced Options in Create an Item
&lt;/h2&gt;&lt;p&gt;The Create a work item action includes advanced options, really they are just optional options. Two of the options are Link URL and Link Type. In this example I used the URL from the previously created item and the Type of Hierarchy-reverse to make this item a child of the previous item.&lt;/p&gt;
&lt;p&gt;Another option is the Assigned To field. I added my email so that when I look in the created item I see that it has been assigned to me.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Showing the expanded create work item action with the Link URL and Link Type highlighted and the Assigned to highlighted. And screen grabs from the backlog showing the 2 related items and the Feature item with me assigned" class="gallery-image" data-flex-basis="303px" data-flex-grow="126" height="538" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/connecting-power-automate-to-devops/2024-07-23_18-03-39.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The first option is Return all fields, which the default is blank. This means the action returns all the item details when it successfully creates the item.&lt;/p&gt;
&lt;h2 id="making-it-solution-aware"&gt;Making it Solution Aware
&lt;/h2&gt;&lt;p&gt;If this flow is part of a solution that is going to move from a development environment to test and production, you will need to point the DevOps actions to the different Organisation and Project values. Thankfully the text values of the Organisation Name, e.g. HatFullOfData can be used.&lt;/p&gt;
&lt;p&gt;So I create 2 environment variables DevOps Organisation and DevOps Project. Then in the create a work item action, in Organisation Name and Project Name drop downs I select Custom Value and then the right value from Dynamic content.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grab of creating the environment variable, what it looks like in the dynamic content and finally using the environment variables for connecting Power Automate to DevOps" class="gallery-image" data-flex-basis="273px" data-flex-grow="113" height="597" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/connecting-power-automate-to-devops/2024-07-24_12-24-14.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;And yes of course after making these changes I test the flow again.&lt;/p&gt;
&lt;h2 id="conclusion-on-connecting-power-automate-to-devops"&gt;Conclusion on Connecting Power Automate to DevOps
&lt;/h2&gt;&lt;p&gt;For when you need to automate the creation of items, this is great. It does not replace importing an Excel file to create a whole plan but it does give an extra set of options to consider.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Foot Notes&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Yes in the new Power Automate experience, at the time of publishing this post, there are no premium labels on connectors or actions &lt;a class="link" href="#65a785ed-7cea-41c5-b383-422365835ab1-link" &gt;↩︎&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Automate – Create Power BI Workspace</title><link>https://hatfullofdata.blog/power-automate-create-power-bi-workspace/</link><pubDate>Fri, 21 Jun 2024 20:18:44 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-create-power-bi-workspace/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/cover.png" alt="Featured image of post Power Automate – Create Power BI Workspace" /&gt;&lt;p&gt;We’ve setup the service principal, saved the details securely in Azure Key Vault and used Power Automate to fetch them securely and finally setup the permissions to allow that service principal to use the rest api. This post will finally create the flow to automatically create Power BI workspace making use of all the preparation.&lt;/p&gt;
&lt;p&gt;This post is part of &lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="start-the-flow-and-get-service-principal-details"&gt;Start the flow and get service principal details
&lt;/h2&gt;&lt;p&gt;There will be an instant flow using a manual trigger. Once the flow editor appears, expand the trigger and add a text input for the Workspace Name.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Build an instant cloud flow and then the trigger expanded to show the Workspace name input" class="gallery-image" data-flex-basis="642px" data-flex-grow="267" height="254" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/2024-06-17_22-00-48.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The first action will be to call the child flow that fetches the tenantid, clientid and secret. Select Get Client Tenant and Secret flow from the dropdown and then use PBI-Workspace as the prefix value.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Run a child flow action" class="gallery-image" data-flex-basis="600px" data-flex-grow="250" height="272" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/2024-06-17_22-19-27.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="http-call-to-automatically-create-power-bi-workspace"&gt;HTTP Call to automatically create Power BI Workspace
&lt;/h2&gt;&lt;p&gt;FInally we can do the action to create Power BI workspace, for this we add a HTTP action. I’m going to break this down into 3 parts, the URI, the body and the authentication.&lt;/p&gt;
&lt;p&gt;&lt;img alt="HTTP action to create Power BI workspace" class="gallery-image" data-flex-basis="226px" data-flex-grow="94" height="719" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/2024-06-18_11-18-49.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;From &lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/power-bi/groups/create-group#examples" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/power-bi/groups/create-group#examples&lt;/a&gt; we can see the HTTP starts with POST so we pick that as the method. It also gives us the URI. To save you going to fetch it here it is&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://api.powerbi.com/v1.0/myorg/groups?workspaceV2=True
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The next part is the body. This is a very simple piece of JSON with only one field name. Get the value of name to come from the trigger input Workspace name.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;name&amp;#34;: &amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The final part is the authentication. Show the Advanced Options to see the boxes to fill in. Firstly Authentication is Active Directory OAuth. Then the Authority can be left blank. Next the Tenant, Client ID and Secret are dynamic values from running the child flow action. Finally the Audience should be the following&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://analysis.windows.net/powerbi/api
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Your flow is now ready to test. Hopefully when you do this it all works and you get green ticks. But when you go to Power BI the workspace is not listed in workspaces you can see. This is because the workspace was created by the service account, so the service account is the admin, not you. So the next step is to add a workspace admin.&lt;/p&gt;
&lt;h2 id="add-workspace-admin"&gt;Add Workspace Admin
&lt;/h2&gt;&lt;p&gt;This is going to require another HTTP call. So if we look at the second example show at &lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/power-bi/groups/update-group-user#examples" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/power-bi/groups/update-group-user#examples&lt;/a&gt; we can see we need 2 pieces of information, the workspace ID and the email address of the workspace admin.&lt;/p&gt;
&lt;p&gt;&lt;img alt="screen grab from the rest api documentation" class="gallery-image" data-flex-basis="591px" data-flex-grow="246" height="276" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/2024-06-18_11-45-27.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The workspace ID must have been returned when we create Power BI workspace. If you look in the dynamic content it won’t be listed though so we need either code by hand or we use my favourite trick of Parse JSON.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Showing the successful HTTP step with output body, and the Parse JSON action with the generate from sample button hghlighted" class="gallery-image" data-flex-basis="417px" data-flex-grow="173" height="391" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/2024-06-18_11-56-01-1.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="get-the-workspace-id"&gt;Get the Workspace ID
&lt;/h3&gt;&lt;p&gt;Go to the test run you did and expand the HTTP call that created the workspace. In the Outputs section there is a Body section which will contain the JSON that was returned. Copy this JSON as this will help complete the Parse JSON.&lt;/p&gt;
&lt;p&gt;Then return to editing the flow and add a Parse JSON action. For the content use the Body returned by the HTTP action. JSON schemas are tricky to write by hand so you can generate it from what we copied. Click on the Generate from sample to open a dialog. Paste the output body we copied earlier and click Done. The Parse JSON step will now have a schema.&lt;/p&gt;
&lt;h3 id="request-the-admin-email"&gt;Request the Admin Email
&lt;/h3&gt;&lt;p&gt;The flow might not be run by the requester of the workspace, so it makes sense to ask for the admin’s email. Add this as an extra input in the trigger.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="549px" data-flex-grow="228" height="297" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/2024-06-18_13-14-33.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="new-http-request-to-add-user"&gt;New HTTP Request to add User
&lt;/h3&gt;&lt;p&gt;&lt;img alt="HTTP step filled in as the instructions below" class="gallery-image" data-flex-basis="217px" data-flex-grow="90" height="750" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/2024-06-18_13-22-11.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Add a new HTTP action, and I recommend renaming it. (Yes that should happen to the first one as well!). Again its a POST method and the URI needs id from the Parse JSON step slotted in. The Body is a simple JSON again. Code for both of these can be copied from below. The authentication is exactly the same as the previous HTTP step.&lt;/p&gt;
&lt;h4 id="uri"&gt;URI
&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://api.powerbi.com/v1.0/myorg/groups//users
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h4 id="body"&gt;Body
&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;emailAddress&amp;#34;: &amp;#34;&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;groupUserAccessRight&amp;#34;: &amp;#34;Admin&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id="conclusion-to-create-power-bi-workspace"&gt;Conclusion to Create Power BI Workspace
&lt;/h2&gt;&lt;p&gt;You should now have a complete flow that when run asks for Workspace Name and Admin Email and creates a workspace with the admin added.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Flow run box with parameters populated and the created workspace showing the Manage Access pane" class="gallery-image" data-flex-basis="725px" data-flex-grow="302" height="225" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-create-power-bi-workspace/2024-06-18_13-46-33.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;This is the MVP of the solution. There are obvious additions such as approvals, notifying the new admin and other various extras that should be included. They may get blogged, lets see.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="more-power-bi-posts"&gt;More Power BI Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-conditional-formatting-update/" target="_blank" rel="noopener"
 &gt;Conditional Formatting Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-data-refresh-date/" target="_blank" rel="noopener"
 &gt;Data Refresh Date&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-inactive-relationships-in-a-measure/" target="_blank" rel="noopener"
 &gt;Using Inactive Relationships in a Measure&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dax-crossfilter-function/" target="_blank" rel="noopener"
 &gt;DAX CrossFilter Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-coalesce-function-to-remove-blanks/" target="_blank" rel="noopener"
 &gt;COALESCE Function to Remove Blanks&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-personalize-visuals/" target="_blank" rel="noopener"
 &gt;Personalize Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-gradient-legends/" target="_blank" rel="noopener"
 &gt;Gradient Legends&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-endorse-a-dataset/" target="_blank" rel="noopener"
 &gt;Endorse a Dataset as Promoted or Certified&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-qa-synonyms-update/" target="_blank" rel="noopener"
 &gt;Q&amp;amp;A Synonyms Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-import-text-using-examples/" target="_blank" rel="noopener"
 &gt;Import Text Using Examples&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/paginated-report-resources/" target="_blank" rel="noopener"
 &gt;Paginated Report Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/charticulator-simple-custom-chart/" target="_blank" rel="noopener"
 &gt;Charticulator&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-connector-july-2022-update/" target="_blank" rel="noopener"
 &gt;Dataverse Connector – July 2022 Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-choices-and-choice-column/" target="_blank" rel="noopener"
 &gt;Dataverse Choice Columns&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-switch-dataverse-tenancy/" target="_blank" rel="noopener"
 &gt;Switch Dataverse Tenancy&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-google-analytics/" target="_blank" rel="noopener"
 &gt;Connecting to Google Analytics&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-take-over-a-dataset/" target="_blank" rel="noopener"
 &gt;Take Over a Dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/export-data-from-power-bi-visuals/" target="_blank" rel="noopener"
 &gt;Export Data from Power BI Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-embed-a-paginated-report/" target="_blank" rel="noopener"
 &gt;Embed a Paginated Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-sql-on-dataverse-for-power-bi/" target="_blank" rel="noopener"
 &gt;Using SQL on Dataverse for Power BI&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-platform-solution-and-power-bi-part-1/" target="_blank" rel="noopener"
 &gt;Power Platform Solution and Power BI Series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-creating-a-custom-smart-narrative/" target="_blank" rel="noopener"
 &gt;Creating a Custom Smart Narrative&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="power-bi-series"&gt;Power BI Series
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;SVG in Power BI series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-project-online/" target="_blank" rel="noopener"
 &gt;Power BI and Project Online series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-slicers-introduction/" target="_blank" rel="noopener"
 &gt;Slicers series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-create-a-dataflow/" target="_blank" rel="noopener"
 &gt;Dataflow series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;Power BI SVG series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-data-into-power-bi/" target="_blank" rel="noopener"
 &gt;Power BI and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Use Power Automate to Fetch Secrets from Key Vault</title><link>https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/</link><pubDate>Wed, 29 May 2024 08:34:09 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/cover.png" alt="Featured image of post Use Power Automate to Fetch Secrets from Key Vault" /&gt;&lt;p&gt;Once you have stored security details in Azure Key Vault as described in the previous post in this series (&lt;a class="link" href="https://hatfullofdata.blog/create-azure-key-vault-to-store-tenant-id-client-id-and-secret/" target="_blank" rel="noopener"
 &gt;Create Azure Key Vault to store Tenant ID, Client ID and Secret&lt;/a&gt;) you need a way to fetch secrets when you need them. Power Automate connector for Azure Key Vault includes the Get Secret action. This post shows you how to build a reusable child flow to fetch secrets.&lt;/p&gt;
&lt;p&gt;This post is part of &lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="flow-design"&gt;Flow design
&lt;/h2&gt;&lt;p&gt;The flow we are going to create will be called by other flows, so is a child flow. The flow will have one parameter of the prefix of the ClientID and Secret store in the Azure Key Vault. If you have completed the previous post this would be PBI–Workspace. It will return 3 values, TenantID, ClientID and Secret which will be secured&lt;/p&gt;
&lt;p&gt;&lt;img alt="List of Secrets ib Azure Key Vault with names PBI-Workspace-ClientID and PBI-Workspace-Secret" class="gallery-image" data-flex-basis="519px" data-flex-grow="216" height="314" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/image.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Because we are using child flows we need to create our flows inside a solution. I recommend creating a solution for these group of flows. I don’t want to make this blog post even longer so please go google creating Power Platform solutions.&lt;/p&gt;
&lt;h2 id="setting-up-the-trigger"&gt;Setting up the Trigger
&lt;/h2&gt;&lt;p&gt;For a child flow we use a instant flow. Type in a descriptive name and select the trigger Manually trigger a flow. When you are in the flow editor, expand the trigger and add an input for the prefix. Adding hint text will help you and other users remember what the input is about.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="645px" data-flex-grow="268" height="253" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/flow-trigger.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="adding-actions-to-fetch-secrets"&gt;Adding Actions to Fetch Secrets
&lt;/h2&gt;&lt;p&gt;The flow is reasonably simple with three repeating actions to fetch secrets. Add an action and search for Key Vault and select it. Then from the list select Get Secret. If this is the first time you have connected to a Key Vault you will need to type in the key vault name and click Sign in. Be aware that every key vault has its own connection.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Azure Key Vault connection setup showing Authentication Type drop down which can be left on default and place to type in Key Vault name" class="gallery-image" data-flex-basis="497px" data-flex-grow="207" height="328" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/2024-04-13_20-45-20.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The action has a very simple drop down. For the TenantID action you can just select it from the drop down. For the ClientID and Secret we want to the prefix value from the trigger so that this flow is reusable. So for the ClientID and Secret select Enter custom value. Then use the dynamic value Prefix followed by -ClientID and -Secret.&lt;/p&gt;
&lt;p&gt;&lt;img alt="three actions to fetch secrets from key vault" class="gallery-image" data-flex-basis="361px" data-flex-grow="150" height="451" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/2024-04-13_22-12-50-1.png" width="679"&gt;&lt;/p&gt;
&lt;h2 id="securing-the-secret-value"&gt;Securing the Secret Value
&lt;/h2&gt;&lt;p&gt;The secret value should be kept secret. So the Action output needs securing. Click on the ellipse (3 dots) on the Get secret – Secret action. Turn on the toggle for Secure Outputs and then click Done at the bottom of the dialog.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Menu showing settings and settings with toggle for Secure Outputs turned on" class="gallery-image" data-flex-basis="500px" data-flex-grow="208" height="326" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/2024-04-14_21-29-11.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;This could be done on ClientID as well if required. Each action that has a security setting applied will show a padlock. When a flow run execution is looked at the value of the secret will not be available.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Action with a padlock and the executed action showing Content not shown due to security configuration" class="gallery-image" data-flex-basis="266px" data-flex-grow="111" height="612" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/2024-04-14_21-47-17.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="returning-the-values"&gt;Returning the Values
&lt;/h2&gt;&lt;p&gt;The final part for this flow is to return the values. And for this flow to run as a child flow it must have a respond action. Click on add action and search for the Power Apps connector. It only one has one action Respond to a Power App or flow. Add three outputs to return TenantID, ClientID and Secret.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Power Apps connection showing Respond action and the action in the flow with three outputs" class="gallery-image" data-flex-basis="256px" data-flex-grow="106" height="636" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/2024-04-14_22-13-18.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="handling-the-connections"&gt;Handling the Connections
&lt;/h2&gt;&lt;p&gt;When an instant flow runs the connections are usually based on who clicked the start on the flow. This does not work for a child flow, so a connection must be selected that will be used for when it runs.&lt;/p&gt;
&lt;p&gt;The changes need to be made from the flow details page, save and click the blue arrow in the top left to get there. Click on Edit in the Run only users box. When the pane appears, under connections used select a connection under Azure Key Vault. A message will appear to state users only get access in this flow, click OK to close it and then click Save to save the changes.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="766px" data-flex-grow="319" height="213" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/2024-04-14_22-39-14.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="testing-the-flow"&gt;Testing the flow
&lt;/h2&gt;&lt;p&gt;When you first write a child flow I suggest you write an instant flow to test it. The Run a Child Flow action only is available if your flows are in a solution. In order to protect the secret value you also need to protect the outputs of the Run a Child flow action.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The flow with Manually trigger a flow trigger connected to Run a Child Flow action that is running Get Tenant and Secret with the parameter Prefix populated with PBI-Workspace" class="gallery-image" data-flex-basis="652px" data-flex-grow="272" height="250" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-to-fetch-secrets-from-key-vault/2024-05-29_09-17-35.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;This tests that the flow runs a child flow and returns values even though we can’t see them.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;We now have an app that can fetch secrets, we’ve secured the authentication details and now written a flow to securely retrieve those values. Next step is to make sure Power BI will allow us to do this.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="more-power-bi-posts"&gt;More Power BI Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-conditional-formatting-update/" target="_blank" rel="noopener"
 &gt;Conditional Formatting Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-data-refresh-date/" target="_blank" rel="noopener"
 &gt;Data Refresh Date&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-inactive-relationships-in-a-measure/" target="_blank" rel="noopener"
 &gt;Using Inactive Relationships in a Measure&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dax-crossfilter-function/" target="_blank" rel="noopener"
 &gt;DAX CrossFilter Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-coalesce-function-to-remove-blanks/" target="_blank" rel="noopener"
 &gt;COALESCE Function to Remove Blanks&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-personalize-visuals/" target="_blank" rel="noopener"
 &gt;Personalize Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-gradient-legends/" target="_blank" rel="noopener"
 &gt;Gradient Legends&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-endorse-a-dataset/" target="_blank" rel="noopener"
 &gt;Endorse a Dataset as Promoted or Certified&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-qa-synonyms-update/" target="_blank" rel="noopener"
 &gt;Q&amp;amp;A Synonyms Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-import-text-using-examples/" target="_blank" rel="noopener"
 &gt;Import Text Using Examples&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/paginated-report-resources/" target="_blank" rel="noopener"
 &gt;Paginated Report Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/charticulator-simple-custom-chart/" target="_blank" rel="noopener"
 &gt;Charticulator&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-connector-july-2022-update/" target="_blank" rel="noopener"
 &gt;Dataverse Connector – July 2022 Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-choices-and-choice-column/" target="_blank" rel="noopener"
 &gt;Dataverse Choice Columns&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-switch-dataverse-tenancy/" target="_blank" rel="noopener"
 &gt;Switch Dataverse Tenancy&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-google-analytics/" target="_blank" rel="noopener"
 &gt;Connecting to Google Analytics&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-take-over-a-dataset/" target="_blank" rel="noopener"
 &gt;Take Over a Dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/export-data-from-power-bi-visuals/" target="_blank" rel="noopener"
 &gt;Export Data from Power BI Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-embed-a-paginated-report/" target="_blank" rel="noopener"
 &gt;Embed a Paginated Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-sql-on-dataverse-for-power-bi/" target="_blank" rel="noopener"
 &gt;Using SQL on Dataverse for Power BI&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-platform-solution-and-power-bi-part-1/" target="_blank" rel="noopener"
 &gt;Power Platform Solution and Power BI Series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-creating-a-custom-smart-narrative/" target="_blank" rel="noopener"
 &gt;Creating a Custom Smart Narrative&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="power-bi-series"&gt;Power BI Series
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;SVG in Power BI series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-project-online/" target="_blank" rel="noopener"
 &gt;Power BI and Project Online series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-slicers-introduction/" target="_blank" rel="noopener"
 &gt;Slicers series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-create-a-dataflow/" target="_blank" rel="noopener"
 &gt;Dataflow series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;Power BI SVG series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-data-into-power-bi/" target="_blank" rel="noopener"
 &gt;Power BI and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Create a Power BI Service Principal Profile</title><link>https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/</link><pubDate>Sat, 17 Feb 2024 18:18:23 +0000</pubDate><guid>https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/</guid><description>&lt;img src="https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/cover.png" alt="Featured image of post Create a Power BI Service Principal Profile" /&gt;&lt;p&gt;For Power Automate to use the Power BI Rest API it needs a service principal profile. This is created by creating an app registration that has the right permissions. This allows an app, e.g. Power Automate, to establish a trust relationship with the Microsoft identity platform. This is done using Entra Admin Center (previously known as Active Directory)&lt;/p&gt;
&lt;p&gt;This post is part of the &lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="create-app-registration-for-service-principal"&gt;Create App Registration for Service Principal
&lt;/h2&gt;&lt;p&gt;Navigate to &lt;a class="link" href="https://entra.microsoft.com/" target="_blank" rel="noopener"
 &gt;https://entra.microsoft.com/&lt;/a&gt;. Then in the menu expand Identity and under that Applications. Finally click on App Registrations to open the list of App Registrations. It defaults to list registrations owned by you.&lt;/p&gt;
&lt;p&gt;&lt;img alt="App Registration list" class="gallery-image" data-flex-basis="528px" data-flex-grow="220" height="309" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/2024-02-11_18-49-28.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Click on New registration to start creating your App registration. Enter a name for your application, remember to make clear as over time the list will grow. Leave rest of the options as default and press the Register button.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Entering App Registration name and register" class="gallery-image" data-flex-basis="535px" data-flex-grow="222" height="305" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/2024-02-11_19-01-35.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="change-app-registration-ownership"&gt;Change App Registration Ownership
&lt;/h2&gt;&lt;p&gt;It is recommended that you add owners to the registration. Click on Owners, then click on Add Owners and select the owners. App owners and administrators can view and edit app registrations.&lt;/p&gt;
&lt;p&gt;&lt;img alt="list of app registration owners" class="gallery-image" data-flex-basis="528px" data-flex-grow="220" height="309" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/2024-02-11_19-41-28.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="adding-api-permissions"&gt;Adding API Permissions
&lt;/h2&gt;&lt;p&gt;Permissions need to be given to the App Registration based on what you want to do. The Power BI Rest API documentation at &lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/power-bi/groups/create-group" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/power-bi/groups/create-group&lt;/a&gt; states you need Workspace.ReadWrite.All.&lt;/p&gt;
&lt;p&gt;Click on API Permissions and then click on Add a permission. When the list of APIs appear, select Power BI service. Then select Delegated permissions and from the list of permissions select Workspace.ReadWrite.All. It is good practice to only add the permissions you need.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Adding an API permission steps" class="gallery-image" data-flex-basis="518px" data-flex-grow="215" height="315" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/2024-02-11_20-12-40.png" width="680"&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;			## Adding a Secret
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The final step in App Registration is to add a secret. This will be required by anyone using the app registration.&lt;/p&gt;
&lt;p&gt;Click on Certificates &amp;amp; secrets, then click on New client secret. Enter in a description, I chose to keep the default 6 months expiration. Click Add to finish creating the secret.&lt;/p&gt;
&lt;p&gt;Once the list appears you must copy the secret value. This is the only chance you get.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Adding a secret to the service principal profile" class="gallery-image" data-flex-basis="413px" data-flex-grow="172" height="395" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/2024-02-11_20-38-15.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="important-information"&gt;Important Information
&lt;/h2&gt;&lt;p&gt;You will need the Secret value copied from the last section and the Tenant ID and Client ID. The final 2 values can be found by clicking on Overview. These values especially the secret need to be kept secure. So the next post is how to create an Azure Key Vault to store the values.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Finding the Client ID and Tenant ID" class="gallery-image" data-flex-basis="384px" data-flex-grow="160" height="424" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/create-a-power-bi-service-principal-profile/2024-02-11_21-07-52.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;Understanding how App Extensions and Service Principals work is very useful not only for Power BI Rest api. The Microsoft Graph api can also be accessed using a service principal but that is a whole different series.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="more-power-bi-posts"&gt;More Power BI Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-conditional-formatting-update/" target="_blank" rel="noopener"
 &gt;Conditional Formatting Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-data-refresh-date/" target="_blank" rel="noopener"
 &gt;Data Refresh Date&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-inactive-relationships-in-a-measure/" target="_blank" rel="noopener"
 &gt;Using Inactive Relationships in a Measure&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dax-crossfilter-function/" target="_blank" rel="noopener"
 &gt;DAX CrossFilter Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-coalesce-function-to-remove-blanks/" target="_blank" rel="noopener"
 &gt;COALESCE Function to Remove Blanks&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-personalize-visuals/" target="_blank" rel="noopener"
 &gt;Personalize Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-gradient-legends/" target="_blank" rel="noopener"
 &gt;Gradient Legends&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-endorse-a-dataset/" target="_blank" rel="noopener"
 &gt;Endorse a Dataset as Promoted or Certified&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-qa-synonyms-update/" target="_blank" rel="noopener"
 &gt;Q&amp;amp;A Synonyms Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-import-text-using-examples/" target="_blank" rel="noopener"
 &gt;Import Text Using Examples&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/paginated-report-resources/" target="_blank" rel="noopener"
 &gt;Paginated Report Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/charticulator-simple-custom-chart/" target="_blank" rel="noopener"
 &gt;Charticulator&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-connector-july-2022-update/" target="_blank" rel="noopener"
 &gt;Dataverse Connector – July 2022 Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-choices-and-choice-column/" target="_blank" rel="noopener"
 &gt;Dataverse Choice Columns&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-switch-dataverse-tenancy/" target="_blank" rel="noopener"
 &gt;Switch Dataverse Tenancy&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-google-analytics/" target="_blank" rel="noopener"
 &gt;Connecting to Google Analytics&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-take-over-a-dataset/" target="_blank" rel="noopener"
 &gt;Take Over a Dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/export-data-from-power-bi-visuals/" target="_blank" rel="noopener"
 &gt;Export Data from Power BI Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-embed-a-paginated-report/" target="_blank" rel="noopener"
 &gt;Embed a Paginated Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-sql-on-dataverse-for-power-bi/" target="_blank" rel="noopener"
 &gt;Using SQL on Dataverse for Power BI&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-platform-solution-and-power-bi-part-1/" target="_blank" rel="noopener"
 &gt;Power Platform Solution and Power BI Series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-creating-a-custom-smart-narrative/" target="_blank" rel="noopener"
 &gt;Creating a Custom Smart Narrative&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="power-bi-series"&gt;Power BI Series
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;SVG in Power BI series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-project-online/" target="_blank" rel="noopener"
 &gt;Power BI and Project Online series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-slicers-introduction/" target="_blank" rel="noopener"
 &gt;Slicers series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-create-a-dataflow/" target="_blank" rel="noopener"
 &gt;Dataflow series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;Power BI SVG series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-data-into-power-bi/" target="_blank" rel="noopener"
 &gt;Power BI and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Automate and Power BI Rest API</title><link>https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/</link><pubDate>Thu, 15 Feb 2024 14:28:37 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/cover.png" alt="Featured image of post Power Automate and Power BI Rest API" /&gt;&lt;p&gt;The Power BI Rest API provides the ability to create a workspace. Power Automate includes an action to make a HTTP call, i.e. a Rest API. So we should be able to get a flow to create a workspace. So that was my goal. Writing the first flow and getting it to work involved so many little steps I had to write blog posts so I would remember the steps.&lt;/p&gt;
&lt;h2 id="power-bi-rest-api-documentation"&gt;Power BI Rest API Documentation
&lt;/h2&gt;&lt;p&gt;The documentation refers to workspaces as groups and can be found at &lt;a class="link" href="https://learn.microsoft.com/en-us/rest/api/power-bi/groups/create-group" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/rest/api/power-bi/groups/create-group&lt;/a&gt;. It states that the API can be called by a service principal profile and the required scope is Workspace.ReadWrite.All.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen shot from the Power BI rest api documentation" class="gallery-image" data-flex-basis="301px" data-flex-grow="125" height="542" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/2024-02-17_17-34-46.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="other-settings"&gt;Other Settings
&lt;/h2&gt;&lt;p&gt;You also need to make some changes to Power BI tenant settings as well and I’d recommend creating a security group and using Azure Key Vault to store the credentials. That would make a very long blog post so I’m breaking it down into separate posts.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/create-a-power-bi-service-principle-profile/" target="_blank" rel="noopener"
 &gt;Create a Power BI Service Principal Profile&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/create-azure-key-vault-to-store-tenant-id-client-id-and-secret/" target="_blank" rel="noopener"
 &gt;Create Key Vault to store Tenant ID, Client ID and Secret&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/use-power-automate-to-fetch-secrets-from-key-vault/" target="_blank" rel="noopener"
 &gt;Write a flow to fetch the Key Vault Values&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/allow-the-use-of-power-bi-rest-apis/" target="_blank" rel="noopener"
 &gt;Update Power BI Settings and Create a Security Group&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Write a flow to create the workspace&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extras for the workspace&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="final-power-automate-flow"&gt;Final Power Automate Flow
&lt;/h2&gt;&lt;p&gt;The final flow, after post 5, fetches the Service Principal credentials using a child flow, then uses HTTP action to create the workspace and with a bit of parse json action magic uses another HTTP action to change the permissions.&lt;/p&gt;
&lt;p&gt;&lt;img alt="5 step flow as described in the previous paragraph" class="gallery-image" data-flex-basis="361px" data-flex-grow="150" height="452" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/2024-06-18_14-19-17.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The above flow has flaws, no error handling, no checking the workspace name is allowed and no notifying the admin they have a new workspace.&lt;/p&gt;
&lt;h2 id="next-steps"&gt;Next Steps
&lt;/h2&gt;&lt;p&gt;This is a simple example of using Power Automate with Power BI rest API to perform some admin tasks. This could easily be extended to include other boring admin tasks.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="more-power-bi-posts"&gt;More Power BI Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-conditional-formatting-update/" target="_blank" rel="noopener"
 &gt;Conditional Formatting Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-data-refresh-date/" target="_blank" rel="noopener"
 &gt;Data Refresh Date&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-inactive-relationships-in-a-measure/" target="_blank" rel="noopener"
 &gt;Using Inactive Relationships in a Measure&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dax-crossfilter-function/" target="_blank" rel="noopener"
 &gt;DAX CrossFilter Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-coalesce-function-to-remove-blanks/" target="_blank" rel="noopener"
 &gt;COALESCE Function to Remove Blanks&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-personalize-visuals/" target="_blank" rel="noopener"
 &gt;Personalize Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-gradient-legends/" target="_blank" rel="noopener"
 &gt;Gradient Legends&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-endorse-a-dataset/" target="_blank" rel="noopener"
 &gt;Endorse a Dataset as Promoted or Certified&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-qa-synonyms-update/" target="_blank" rel="noopener"
 &gt;Q&amp;amp;A Synonyms Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-import-text-using-examples/" target="_blank" rel="noopener"
 &gt;Import Text Using Examples&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/paginated-report-resources/" target="_blank" rel="noopener"
 &gt;Paginated Report Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/charticulator-simple-custom-chart/" target="_blank" rel="noopener"
 &gt;Charticulator&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-connector-july-2022-update/" target="_blank" rel="noopener"
 &gt;Dataverse Connector – July 2022 Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-choices-and-choice-column/" target="_blank" rel="noopener"
 &gt;Dataverse Choice Columns&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-switch-dataverse-tenancy/" target="_blank" rel="noopener"
 &gt;Switch Dataverse Tenancy&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-google-analytics/" target="_blank" rel="noopener"
 &gt;Connecting to Google Analytics&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-take-over-a-dataset/" target="_blank" rel="noopener"
 &gt;Take Over a Dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/export-data-from-power-bi-visuals/" target="_blank" rel="noopener"
 &gt;Export Data from Power BI Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-embed-a-paginated-report/" target="_blank" rel="noopener"
 &gt;Embed a Paginated Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-sql-on-dataverse-for-power-bi/" target="_blank" rel="noopener"
 &gt;Using SQL on Dataverse for Power BI&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-platform-solution-and-power-bi-part-1/" target="_blank" rel="noopener"
 &gt;Power Platform Solution and Power BI Series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-creating-a-custom-smart-narrative/" target="_blank" rel="noopener"
 &gt;Creating a Custom Smart Narrative&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="power-bi-series"&gt;Power BI Series
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;SVG in Power BI series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-project-online/" target="_blank" rel="noopener"
 &gt;Power BI and Project Online series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-slicers-introduction/" target="_blank" rel="noopener"
 &gt;Slicers series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-create-a-dataflow/" target="_blank" rel="noopener"
 &gt;Dataflow series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;Power BI SVG series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-data-into-power-bi/" target="_blank" rel="noopener"
 &gt;Power BI and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Automate – Write Me a Flow</title><link>https://hatfullofdata.blog/power-automate-write-me-a-flow/</link><pubDate>Wed, 09 Aug 2023 16:44:09 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-write-me-a-flow/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-write-me-a-flow/cover.png" alt="Featured image of post Power Automate – Write Me a Flow" /&gt;&lt;p&gt;Power Automate create includes a feature called Describe it to design it which will write me a flow if I can describe it. In Aug 2023 its still in preview, and is not 100% and only copes with simple requests. It doesn’t require a co-pilot licence though!&lt;/p&gt;
&lt;p&gt;I started to explore this feature for a session for Scottish Summit 2023, trying to do 3 demos in a 25 minute session, I needed my first demo to be quick.&lt;/p&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;&lt;a class="link" href="https://youtu.be/VckJtQdbg6Q" target="_blank" rel="noopener"
 &gt;&lt;img alt="Thumbnail from the YouTube video Power Automate Write me a flow" class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="383" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-write-me-a-flow/Power-Automate-write-a-flow-for-me-Time-0_00_0000.png" width="680"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="getting-started"&gt;Getting Started
&lt;/h2&gt;&lt;p&gt;&lt;img alt="Describe it to design it tile from Create page in Power Automate" class="gallery-image" data-flex-basis="259px" data-flex-grow="108" height="277" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-write-me-a-flow/image-8.png" width="300"&gt;&lt;/p&gt;
&lt;p&gt;On Power Automate site click on Create and then click on the Describe it to design it tile. This starts a 3 step process. The first step is to describe the flow. My simple request was when I added a new file to a SharePoint library that the Power BI report that was based on that library got refreshed.&lt;/p&gt;
&lt;p&gt;Once Step 1 appears I enter in my request using a “When X then Y” pattern. It will show you a list of suggestions as you type. Click the arrow to submit the description. If it works you get a suggested flow and you can click Next to move onto Step 2&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="197px" data-flex-grow="82" height="826" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-write-me-a-flow/image-10.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When it cannot translate your description into a flow, it shows a message of No flow suggestions. This feature is in preview currently so its not yet working 100%. There are links to provide feedback, they can’t fix what you don’t tell them.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="542px" data-flex-grow="225" height="301" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-write-me-a-flow/image-11.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="step-2--connections"&gt;Step 2 – Connections
&lt;/h2&gt;&lt;p&gt;When you click next it takes you to step 2 of 3. Here you are asked to review the connections the flow will use.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="417px" data-flex-grow="173" height="333" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-write-me-a-flow/image-12.png" width="579"&gt;&lt;/p&gt;
&lt;h2 id="step-3--settings"&gt;Step 3 – Settings
&lt;/h2&gt;&lt;p&gt;The final step is to add some settings to the flow steps. The drop downs are populated just like in the full flow editor. In some of my explorations it didn’t give me everything I needed but it works mostly. The you click Create flow.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="227px" data-flex-grow="94" height="716" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-write-me-a-flow/image-13.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="power-automate-did-write-me-a-flow"&gt;Power Automate did write me a flow!
&lt;/h2&gt;&lt;p&gt;Very quickly you get presented with a flow. I recommend editing the name in the top left and of course pressing save in the top right. Then test your flow out.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="449px" data-flex-grow="187" height="363" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-write-me-a-flow/image-14.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;For getting started, asking Power Automate to write me a flow is great. For developing a long complex flow its not going to help much. It does allow you to explore some ideas and with the right description it will build longer flows.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Automate Button in a Power BI Report</title><link>https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/</link><pubDate>Mon, 07 Aug 2023 20:39:39 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/cover.png" alt="Featured image of post Power Automate Button in a Power BI Report" /&gt;&lt;p&gt;You can add an action to a Power BI report by adding a Power Automate button. The button will trigger a flow to run and perform actions. You add data to be used in the flow. In this post I will show to use a flow to add a row to a table that the report is connected to.&lt;/p&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;&lt;a class="link" href="https://www.youtube.com/watch?v=B59qRKCzV4g" target="_blank" rel="noopener"
 &gt;&lt;img class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="383" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/Power-Automate-button-in-a-Power-BI-report-Time-0_00_0000.png" width="680"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="problem-definition"&gt;Problem Definition
&lt;/h2&gt;&lt;p&gt;The report is connected to a table in a database that contains the start times of sections in a bike ride. The section times are used to for calculations and colouring charts. There are three measures that calculate the values to put in a new row of data. I want a Power Automate button to insert a row into my database table.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grab showing the table of data and the chart it highlights in different colours" class="gallery-image" data-flex-basis="318px" data-flex-grow="132" height="513" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/image-1.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="add-a-power-automate-button"&gt;Add a Power Automate Button
&lt;/h2&gt;&lt;p&gt;From the Insert ribbon tab in Power BI desktop, we select the Power Automate visual. It’s right down the bottom under Other. This will add you a visual that includes instructions. The first step is adding data to the visual that will get passed into the flow. I have added my three measures.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen shots showing adding the Power Automate button to the report from the drop down on the Insert ribbon" class="gallery-image" data-flex-basis="445px" data-flex-grow="185" height="366" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/image-2.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="creating-the-flow"&gt;Creating the flow
&lt;/h2&gt;&lt;p&gt;After you add the data, the next step creates the flow. Click on the … link on the top of the visual and select Edit. This will open a window in Power BI desktop showing you templates and any existing flows that you have.&lt;/p&gt;
&lt;p&gt;In the top left, select New and select Instant cloud flow. Then the window moves to give you Power Automate flow editor inside Power BI desktop. Be aware it will be using the credentials you logged into Power BI with.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="359px" data-flex-grow="149" height="454" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/image-3.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Then you can click New step and add your actions. In this example I am using SQL Server connection Action to insert a row to a table. I populate the Server name, Database name and Table name. Then the table fields appear. When I click in ActivityID, the first field the Dynamic content shows me the fields available including values I added to the Power Automate button.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="454px" data-flex-grow="189" height="359" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/image-4.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When I click on Power BI data Selected Activity ID, measure from my report, it populates the box and it also puts the action into a Apply to each. This is because the values are sent to the flow in a table. When writing the flow it knows its a table so assumes it could be multiple values so therefore adds the apply to each.&lt;/p&gt;
&lt;p&gt;There are multiple ways to handle this and convert that table into just three values, or we can accept we know the Apply to each only ever get a single row. Add a comment in your documentation to save future confusion.&lt;/p&gt;
&lt;h2 id="save-and-apply-the-flow"&gt;Save and Apply the Flow
&lt;/h2&gt;&lt;p&gt;When you have completed your flow. You need to add a name in the top left. Then click Save and then click Save and Apply. Yes you need to click both!&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen shot showing the places to change the flow name, click Save and then click Save and " class="gallery-image" data-flex-basis="496px" data-flex-grow="206" height="329" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/image-5.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;After you click Save and Apply you should get a success message in a green bar. Then you can click Back to Report in the top left.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="694px" data-flex-grow="289" height="235" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/image-6.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The visual in your report will now have changed to be a blue button. And you can test it out. In Power BI desktop you need to Ctrl + click, when you publish you can just click the button.&lt;/p&gt;
&lt;h2 id="formatting-the-button"&gt;Formatting the Button
&lt;/h2&gt;&lt;p&gt;Similar to other Power BI visuals formatting can be applied. The blue isn’t a theme colour so I recommend selecting a theme colour so it will change with themes. You also can tweak padding, shadows and the text to make it look part of the report. I could not find a way to change the arrow icon.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1295px" data-flex-grow="539" height="126" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/image-7.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="flow-environments"&gt;Flow Environments
&lt;/h2&gt;&lt;p&gt;A Power Automate flow lives in an Environment and developers usually get to select which environment and get to put flows into solutions ready to go through a development life cycle. When writing that flow in Power BI desktop you do not get a choice on environment. It goes into Default environment and therefore cannot be put through any development lifecycle.&lt;/p&gt;
&lt;p&gt;One workaround / hack exists. Thank you to James Reeves who pointed it out in a &lt;a class="link" href="https://www.linkedin.com/posts/powerbi-limited_re-power-automate-environment-power-bi-activity-7093135914809311232-mQ_v/" target="_blank" rel="noopener"
 &gt;LinkedIn Post&lt;/a&gt;. It works currently but its a hack and should be treated as such.&lt;/p&gt;
&lt;h2 id="flow-permissions-and-licences"&gt;Flow Permissions and licences
&lt;/h2&gt;&lt;p&gt;When the flow runs it runs as the user who clicks the button. This means firstly the user must have access to the flow, so don’t forget to share it and if like in my example it uses premium connectors the user needs the right licences.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;Adding a way to react to the data and do write is great and Power Automate does it pretty well. There are some missing features though, I’d like to select environment for the flow and be able to select a flow from the solution I’ve added the Power BI report to. And then include that in the solution lifecycle management.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="more-power-bi-posts"&gt;More Power BI Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-conditional-formatting-update/" target="_blank" rel="noopener"
 &gt;Conditional Formatting Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-data-refresh-date/" target="_blank" rel="noopener"
 &gt;Data Refresh Date&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-inactive-relationships-in-a-measure/" target="_blank" rel="noopener"
 &gt;Using Inactive Relationships in a Measure&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dax-crossfilter-function/" target="_blank" rel="noopener"
 &gt;DAX CrossFilter Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-coalesce-function-to-remove-blanks/" target="_blank" rel="noopener"
 &gt;COALESCE Function to Remove Blanks&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-personalize-visuals/" target="_blank" rel="noopener"
 &gt;Personalize Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-gradient-legends/" target="_blank" rel="noopener"
 &gt;Gradient Legends&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-endorse-a-dataset/" target="_blank" rel="noopener"
 &gt;Endorse a Dataset as Promoted or Certified&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-qa-synonyms-update/" target="_blank" rel="noopener"
 &gt;Q&amp;amp;A Synonyms Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-import-text-using-examples/" target="_blank" rel="noopener"
 &gt;Import Text Using Examples&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/paginated-report-resources/" target="_blank" rel="noopener"
 &gt;Paginated Report Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/charticulator-simple-custom-chart/" target="_blank" rel="noopener"
 &gt;Charticulator&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-connector-july-2022-update/" target="_blank" rel="noopener"
 &gt;Dataverse Connector – July 2022 Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-choices-and-choice-column/" target="_blank" rel="noopener"
 &gt;Dataverse Choice Columns&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-switch-dataverse-tenancy/" target="_blank" rel="noopener"
 &gt;Switch Dataverse Tenancy&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-google-analytics/" target="_blank" rel="noopener"
 &gt;Connecting to Google Analytics&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-take-over-a-dataset/" target="_blank" rel="noopener"
 &gt;Take Over a Dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/export-data-from-power-bi-visuals/" target="_blank" rel="noopener"
 &gt;Export Data from Power BI Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-embed-a-paginated-report/" target="_blank" rel="noopener"
 &gt;Embed a Paginated Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-sql-on-dataverse-for-power-bi/" target="_blank" rel="noopener"
 &gt;Using SQL on Dataverse for Power BI&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-platform-solution-and-power-bi-part-1/" target="_blank" rel="noopener"
 &gt;Power Platform Solution and Power BI Series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-creating-a-custom-smart-narrative/" target="_blank" rel="noopener"
 &gt;Creating a Custom Smart Narrative&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="power-bi-series"&gt;Power BI Series
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;SVG in Power BI series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-project-online/" target="_blank" rel="noopener"
 &gt;Power BI and Project Online series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-slicers-introduction/" target="_blank" rel="noopener"
 &gt;Slicers series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-create-a-dataflow/" target="_blank" rel="noopener"
 &gt;Dataflow series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;Power BI SVG series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-data-into-power-bi/" target="_blank" rel="noopener"
 &gt;Power BI and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Automate – Get data from a Power BI dataset</title><link>https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/</link><pubDate>Tue, 11 Jul 2023 16:05:12 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/cover.png" alt="Featured image of post Power Automate – Get data from a Power BI dataset" /&gt;&lt;p&gt;Power BI datasets contain a rich useful data resource that would be really useful in a Power Automate flow. In this post we will walk through how to get data from a Power BI dataset and then email that data. This is just one example of how you could use data fetched from a Power BI dataset behind a report.&lt;/p&gt;
&lt;h2 id="youtube-version"&gt;YouTube Version
&lt;/h2&gt;&lt;p&gt;&lt;a class="link" href="https://youtu.be/HMAMtYYcS7M" target="_blank" rel="noopener"
 &gt;&lt;img alt="Thumbnail from YouTube" class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="383" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/Power-Automate-get-data-from-Power-BI-dataset-Time-0_00_0000.png" width="680"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="starting-the-flow"&gt;Starting the Flow
&lt;/h2&gt;&lt;p&gt;In this example we want to send a monthly quick summary. So I started by creating a scheduled email, repeated every month. After I enter the flow name and change the repeat to every month rather than the default every minute! Now I can press Create, which after a few moments creates a flow with the recurrence step.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grabs showing the Scheduled cloud flow tile and then the first dialog to enter in the flow name and then select repeat monthly. Finally a screen grab of the flow with the recurrence trigger." class="gallery-image" data-flex-basis="410px" data-flex-grow="170" height="398" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/2023-07-07_13-53-21.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="fetch-data-using-a-power-bi-step"&gt;Fetch Data using a Power BI step
&lt;/h2&gt;&lt;p&gt;Click on New step to start the process. In the search box type in Power BI and click on the Power BI tile when it appears. Now you can search the Power BI actions. In the search box enter in query and this will filter to 2 actions. The action we want is Run a query against a dataset.&lt;a class="link" href="#footnote_1_1771" &gt;1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grabs showing the search for Power BI and then searching for query in the Power BI actions." class="gallery-image" data-flex-basis="802px" data-flex-grow="334" height="203" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/2023-07-10_11-14-26.png" width="679"&gt;&lt;/p&gt;
&lt;p&gt;When the step appears, I select the Workspace and Dataset I am interested in. The query text is expecting a DAX statement. Don’t worry you don’t have to write the DAX by hand, we can get Power BI desktop to do it for us.&lt;/p&gt;
&lt;p&gt;&lt;img alt="screen grab of the Run a query step with the workspace and dataset populated, but the query text is blank." class="gallery-image" data-flex-basis="570px" data-flex-grow="237" height="264" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/2023-07-10_11-57-28.png" width="628"&gt;&lt;/p&gt;
&lt;h2 id="writing-the-query-text"&gt;Writing the Query Text
&lt;/h2&gt;&lt;p&gt;Power BI desktop can write the query text for you. You need to open the Power BI report or a report connected to the dataset. On a blank page add a table visual. Populate the table with the data you want to use in Power Automate remember to apply the correct filters. I also recommend you remove totals unless you want the totals row in your data.&lt;/p&gt;
&lt;p&gt;In my example the table shows Total Sales and Sales Growth for products in the previous month, using Offset Month column from my calendar.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grab showing the build a visual pane, filters on this visual and the Totals setting turned off to build the table, also shown" class="gallery-image" data-flex-basis="249px" data-flex-grow="103" height="655" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/2023-07-10_13-33-14.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;After creating the table, on the Optimize ribbon tab click on Performance analyzer&lt;a class="link" href="#footnote_2_1771" &gt;2&lt;/a&gt;. When the pane appears on the right hand side, click on Start Recording. Then you click on Refresh Visuals. This tool is usually used for analysing how long each visual takes to refresh and part of that is to provide the query being run.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Toolbar showing the Perfomance Analyser on the ribbon and then the pane that appears" class="gallery-image" data-flex-basis="220px" data-flex-grow="91" height="738" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/2023-07-10_13-49-18.png" width="677"&gt;&lt;/p&gt;
&lt;p&gt;Expand the Table line by clicking on the +. Then click on Copy Query. Now you can return to the flow in Power Automate and paste the query into the query box.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Power Automate step with the query pasted to get data from a Power BI dataset" class="gallery-image" data-flex-basis="228px" data-flex-grow="95" height="715" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/2023-07-10_14-07-28.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="sending-the-email"&gt;Sending the Email
&lt;/h2&gt;&lt;p&gt;The final part of this process is to create the email to send the details. The Power BI step returns an array of the rows of data. The Send an Email action would like this array converted into a html table. So we need 2 actions, create HTML table and Send an email. I am not going to make the table or email pretty. That is a separate post!&lt;/p&gt;
&lt;p&gt;&lt;img alt="2 steps in Power Automate to create html table and then send the email." class="gallery-image" data-flex-basis="276px" data-flex-grow="115" height="551" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/2023-07-10_17-04-31.png" width="635"&gt;&lt;/p&gt;
&lt;h2 id="testing-the-flow"&gt;Testing the flow
&lt;/h2&gt;&lt;p&gt;I would test as I added each action to the flow, even on a short flow. Obviously once completed I’d test again.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grab showing the 4 steps in the flow all with green ticks and the email as the final result." class="gallery-image" data-flex-basis="652px" data-flex-grow="272" height="250" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/2023-07-11_16-31-57.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="resources"&gt;Resources
&lt;/h2&gt;&lt;p&gt;The report used for this example can be found on my &lt;a class="link" href="https://github.com/Laura-GB/DemoData#readme" target="_blank" rel="noopener"
 &gt;GitHub&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Power BI Report – &lt;a class="link" href="https://github.com/Laura-GB/DemoData/raw/main/Sales%20Data.pbix" target="_blank" rel="noopener"
 &gt;https://github.com/Laura-GB/DemoData/raw/main/Sales%20Data.pbix&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Excel file &lt;a class="link" href="https://github.com/Laura-GB/DemoData/raw/main/Sales%20Data.xlsx" target="_blank" rel="noopener"
 &gt;https://github.com/Laura-GB/DemoData/raw/main/Sales%20Data.xlsx&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;Remember its Power Automate not Power Integrate. So yes you can load a long list into Power Automate but this is not a good tool to load large quantities of data into a new system. This is a brilliant feature though that unlocks data in a dataset for an automation process.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="more-power-bi-posts"&gt;More Power BI Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-conditional-formatting-update/" target="_blank" rel="noopener"
 &gt;Conditional Formatting Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-data-refresh-date/" target="_blank" rel="noopener"
 &gt;Data Refresh Date&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-inactive-relationships-in-a-measure/" target="_blank" rel="noopener"
 &gt;Using Inactive Relationships in a Measure&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dax-crossfilter-function/" target="_blank" rel="noopener"
 &gt;DAX CrossFilter Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-coalesce-function-to-remove-blanks/" target="_blank" rel="noopener"
 &gt;COALESCE Function to Remove Blanks&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-personalize-visuals/" target="_blank" rel="noopener"
 &gt;Personalize Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-gradient-legends/" target="_blank" rel="noopener"
 &gt;Gradient Legends&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-endorse-a-dataset/" target="_blank" rel="noopener"
 &gt;Endorse a Dataset as Promoted or Certified&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-qa-synonyms-update/" target="_blank" rel="noopener"
 &gt;Q&amp;amp;A Synonyms Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-import-text-using-examples/" target="_blank" rel="noopener"
 &gt;Import Text Using Examples&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/paginated-report-resources/" target="_blank" rel="noopener"
 &gt;Paginated Report Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/charticulator-simple-custom-chart/" target="_blank" rel="noopener"
 &gt;Charticulator&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-connector-july-2022-update/" target="_blank" rel="noopener"
 &gt;Dataverse Connector – July 2022 Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-choices-and-choice-column/" target="_blank" rel="noopener"
 &gt;Dataverse Choice Columns&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-switch-dataverse-tenancy/" target="_blank" rel="noopener"
 &gt;Switch Dataverse Tenancy&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-google-analytics/" target="_blank" rel="noopener"
 &gt;Connecting to Google Analytics&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-take-over-a-dataset/" target="_blank" rel="noopener"
 &gt;Take Over a Dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/export-data-from-power-bi-visuals/" target="_blank" rel="noopener"
 &gt;Export Data from Power BI Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-embed-a-paginated-report/" target="_blank" rel="noopener"
 &gt;Embed a Paginated Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-sql-on-dataverse-for-power-bi/" target="_blank" rel="noopener"
 &gt;Using SQL on Dataverse for Power BI&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-platform-solution-and-power-bi-part-1/" target="_blank" rel="noopener"
 &gt;Power Platform Solution and Power BI Series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-creating-a-custom-smart-narrative/" target="_blank" rel="noopener"
 &gt;Creating a Custom Smart Narrative&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="power-bi-series"&gt;Power BI Series
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;SVG in Power BI series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-project-online/" target="_blank" rel="noopener"
 &gt;Power BI and Project Online series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-slicers-introduction/" target="_blank" rel="noopener"
 &gt;Slicers series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-create-a-dataflow/" target="_blank" rel="noopener"
 &gt;Dataflow series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;Power BI SVG series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-data-into-power-bi/" target="_blank" rel="noopener"
 &gt;Power BI and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The other action I have no idea how it works and have yet to find any documentation [&lt;a class="link" href="#identifier_1_1771" &gt;↩&lt;/a&gt;]&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In earlier versions of Power BI it was on the view ribbon [&lt;a class="link" href="#identifier_2_1771" &gt;↩&lt;/a&gt;]&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Automate Child Flow</title><link>https://hatfullofdata.blog/power-automate-child-flow/</link><pubDate>Thu, 14 Jul 2022 12:34:07 +0000</pubDate><guid>https://hatfullofdata.blog/power-automate-child-flow/</guid><description>&lt;img src="https://hatfullofdata.blog/power-automate-child-flow/cover.jpg" alt="Featured image of post Power Automate Child Flow" /&gt;&lt;p&gt;Occasionally it is useful to break your flow apart into separate flows. For this you need to create a child flow or two. There is one tweak I always forget, hence this post.&lt;/p&gt;
&lt;h3 id="create-the-child-flow"&gt;Create the Child Flow
&lt;/h3&gt;&lt;p&gt;When building child flows you need to follow these rules&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Child flows need to be built inside a solution&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The trigger needs to be a Manually trigger a flow. Add inputs to the trigger.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To return values back to the parent flow the last action should a Respond to PowerApp of Flow action.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt="Child flow with showing Manual trigger, get weather action and Respond to Power App action" class="gallery-image" data-flex-basis="206px" data-flex-grow="86" height="789" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-child-flow/Child-Flows-001.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Above is a very simple example. The trigger has an input of location and the child flow will return 3 values.&lt;/p&gt;
&lt;h3 id="calling-the-child-flow"&gt;Calling the Child Flow
&lt;/h3&gt;&lt;p&gt;Now you have created your child flow and tested that it works you can now call it. In the parent flow, add the action Run a child flow. Select your child flow and populate the inputs.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Snapshot showing the Run a child flow in the action list and the Run a child flow action once added to your flow" class="gallery-image" data-flex-basis="1227px" data-flex-grow="511" height="133" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-child-flow/Child-Flows-002.jpg" width="680"&gt;As soon as you add this you will probably get an error in the flow checker. Stating “Update the child flow for action ‘Run a child flow’ to not use ‘run-only user’ connections”&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen showing a red dot next to flow checker in the flow window and then the results if you click on flow checker" class="gallery-image" data-flex-basis="295px" data-flex-grow="123" height="552" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-child-flow/Child-Flows-003.jpg" width="680"&gt;&lt;/p&gt;
&lt;h3 id="fixing-the-child-flow"&gt;Fixing the Child Flow
&lt;/h3&gt;&lt;p&gt;Return back to the child flow information page. In the bottom right of the window look for Run only users box. When you have found it, click Edit. For each connection change the Provided by run-only user to the connection listed. You get a dialog stating the run-only users only get access to the connections for this flow. Click OK.&lt;/p&gt;
&lt;p&gt;&lt;img alt="pictures showing the steps from run only users to connections used " class="gallery-image" data-flex-basis="422px" data-flex-grow="176" height="386" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-automate-child-flow/Child-Flows-004.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When you have updated all the connections remember to click save.&lt;/p&gt;
&lt;p&gt;You can now return to the parent flow. You might need to re-add the action but you will no longer get an error.&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion
&lt;/h3&gt;&lt;p&gt;Child flows are a great way to re-use logic and break a process down into manageable parts.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Refreshing Datasets Automatically with Power BI Dataflows</title><link>https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/</link><pubDate>Sun, 29 Aug 2021 18:58:12 +0000</pubDate><guid>https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/</guid><description>&lt;img src="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/cover.png" alt="Featured image of post Refreshing Datasets Automatically with Power BI Dataflows" /&gt;&lt;p&gt;&lt;img alt="Workspace showing the link from web to workspace to dataset to report." class="gallery-image" data-flex-basis="1305px" data-flex-grow="544" height="125" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/RefreshDataset_001-1.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;I have a report, Open Issues, that has a Power BI dataflow as a data source. If I just use scheduled refreshes, my options are limited. I need to be refreshing datasets automatically after the dataflow has finished so my reports are up to date as soon as possible to avoid a situation where I schedule the dataflow to refresh at 10am and the next slot available might be 10:30am, for example. This can be done using Power Automate.&lt;/p&gt;
&lt;h3 id="create-a-flow-in-power-automate"&gt;Create a flow in Power Automate
&lt;/h3&gt;&lt;p&gt;Head to Power Automate at &lt;a class="link" href="https://flow.microsoft.com/" target="_blank" rel="noopener"
 &gt;https://flow.microsoft.com/&lt;/a&gt;and click on Create on the left hand side menu. The flow will be triggered by the dataflow refresh finishing. This means it is automated so click on Automated cloud flow.&lt;/p&gt;
&lt;p&gt;&lt;img alt="screen grab of Power Automate showing location of Create button and Automated cloud flow button" class="gallery-image" data-flex-basis="528px" data-flex-grow="220" height="309" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/RefreshDataset_002.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;A dialog appears asking for details of the flow. You need to enter in a name for the flow. Then in the search box enter in power to find relevant triggers. Select When a dataflow refresh completes and click Create.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Build a flow dialog box" class="gallery-image" data-flex-basis="375px" data-flex-grow="156" height="435" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/RefreshDataset_003.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;After you click Create the flow editor appears with the trigger already added. For Group Type select Workspace. Then you can select the workspace name for Group. Then you can select the Dataflow.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Trigger step showing values set for Group Type, Group and Dataflow" class="gallery-image" data-flex-basis="500px" data-flex-grow="208" height="326" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/refreshissues_003.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;We then need to refresh the connected report dataset. So we click New step. In the Choose an operation dialog, we type dataset into the search box. This will find you the action Refresh a dataset. We click on the action to add it to the flow.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Adding the step for Refreshing datasets automatically" class="gallery-image" data-flex-basis="622px" data-flex-grow="259" height="262" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/refreshissues_004.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Then you need to select the Workspace and Dataset in the action. The flow is complete, so we can click Save.&lt;/p&gt;
&lt;h3 id="testing-the-flow"&gt;Testing the Flow
&lt;/h3&gt;&lt;p&gt;The flow triggers when the dataflow finishes refreshing. If we refresh the dataflow that will test the flow. I clicked refresh on the dataflow at 3pm and it triggered the flow which then refreshed the dataset.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen grabs of the workspace showing the refresh date and times and a screen grab from the flow runs showing the matching date and time." class="gallery-image" data-flex-basis="348px" data-flex-grow="145" height="468" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/refreshissues_005.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;In the workspace we can see the date and time of the refreshes and if the flow has worked correctly the dataset should be refreshed just after the dataflow. If you look at the history of the flow runs there should be a matching flow run just after the dataflow finished refreshing.&lt;/p&gt;
&lt;h3 id="when-refreshing-datasets-automatically-fails"&gt;When refreshing datasets automatically fails
&lt;/h3&gt;&lt;p&gt;It is worth pointing out that if the dataset refresh fails the flow will not reflect that and will show succeeded in the flow runs. So it is worth checking that the dataset can refresh successfully.&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion
&lt;/h3&gt;&lt;p&gt;This idea can be extended to refresh multiple datasets over multiple workspaces that are connected to the dataflow. This simplifies the process of scheduling refreshes. It also could allow for notifications to interested report owners to be told of the refreshes etc.&lt;/p&gt;
&lt;h2 id="more-power-automate-posts"&gt;More Power Automate Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/" target="_blank" rel="noopener"
 &gt;Creating Adaptive Cards&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-child-flow/" target="_blank" rel="noopener"
 &gt;Power Automate Child Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-get-data-from-a-power-bi-dataset/" target="_blank" rel="noopener"
 &gt;Get data from a Power BI dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-write-me-a-flow/" target="_blank" rel="noopener"
 &gt;Write Me a Flow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/connecting-power-automate-to-devops/" target="_blank" rel="noopener"
 &gt;Power Automate and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-save-a-file-to-onelake-lakehouse/" target="_blank" rel="noopener"
 &gt;Save a File to OneLake Lakehouse&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/trigger-microsoft-fabric-data-pipeline/" target="_blank" rel="noopener"
 &gt;Trigger Microsoft Fabric Data Pipeline using Power Automate&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="more-power-bi-posts"&gt;More Power BI Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-conditional-formatting-update/" target="_blank" rel="noopener"
 &gt;Conditional Formatting Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-data-refresh-date/" target="_blank" rel="noopener"
 &gt;Data Refresh Date&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-inactive-relationships-in-a-measure/" target="_blank" rel="noopener"
 &gt;Using Inactive Relationships in a Measure&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dax-crossfilter-function/" target="_blank" rel="noopener"
 &gt;DAX CrossFilter Function&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-coalesce-function-to-remove-blanks/" target="_blank" rel="noopener"
 &gt;COALESCE Function to Remove Blanks&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-personalize-visuals/" target="_blank" rel="noopener"
 &gt;Personalize Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-gradient-legends/" target="_blank" rel="noopener"
 &gt;Gradient Legends&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-endorse-a-dataset/" target="_blank" rel="noopener"
 &gt;Endorse a Dataset as Promoted or Certified&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-qa-synonyms-update/" target="_blank" rel="noopener"
 &gt;Q&amp;amp;A Synonyms Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-import-text-using-examples/" target="_blank" rel="noopener"
 &gt;Import Text Using Examples&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/paginated-report-resources/" target="_blank" rel="noopener"
 &gt;Paginated Report Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/refreshing-datasets-automatically-with-dataflow/" target="_blank" rel="noopener"
 &gt;Refreshing Datasets Automatically with Power BI Dataflows&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/charticulator-simple-custom-chart/" target="_blank" rel="noopener"
 &gt;Charticulator&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-connector-july-2022-update/" target="_blank" rel="noopener"
 &gt;Dataverse Connector – July 2022 Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-dataverse-choices-and-choice-column/" target="_blank" rel="noopener"
 &gt;Dataverse Choice Columns&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-switch-dataverse-tenancy/" target="_blank" rel="noopener"
 &gt;Switch Dataverse Tenancy&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-google-analytics/" target="_blank" rel="noopener"
 &gt;Connecting to Google Analytics&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-take-over-a-dataset/" target="_blank" rel="noopener"
 &gt;Take Over a Dataset&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/export-data-from-power-bi-visuals/" target="_blank" rel="noopener"
 &gt;Export Data from Power BI Visuals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-embed-a-paginated-report/" target="_blank" rel="noopener"
 &gt;Embed a Paginated Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/using-sql-on-dataverse-for-power-bi/" target="_blank" rel="noopener"
 &gt;Using SQL on Dataverse for Power BI&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-platform-solution-and-power-bi-part-1/" target="_blank" rel="noopener"
 &gt;Power Platform Solution and Power BI Series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-creating-a-custom-smart-narrative/" target="_blank" rel="noopener"
 &gt;Creating a Custom Smart Narrative&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-button-in-a-power-bi-report/" target="_blank" rel="noopener"
 &gt;Power Automate Button in a Power BI Report&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="power-bi-series"&gt;Power BI Series
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;SVG in Power BI series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-connecting-to-project-online/" target="_blank" rel="noopener"
 &gt;Power BI and Project Online series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-slicers-introduction/" target="_blank" rel="noopener"
 &gt;Slicers series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-bi-create-a-dataflow/" target="_blank" rel="noopener"
 &gt;Dataflow series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/svg-in-power-bi-part-1-svg-basics/" target="_blank" rel="noopener"
 &gt;Power BI SVG series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-automate-and-power-bi-rest-api/" target="_blank" rel="noopener"
 &gt;Power Automate and Power BI Rest API series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/devops-data-into-power-bi/" target="_blank" rel="noopener"
 &gt;Power BI and DevOps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Power Query in Flow – Summarising the Data</title><link>https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/</link><pubDate>Mon, 23 Sep 2019 08:33:01 +0000</pubDate><guid>https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/</guid><description>&lt;p&gt;This is the third post in my series regarding Power Query in Flow. In this post I will look at the different options we have for summarising the data using grouping and pivoting with Power Query.&lt;/p&gt;
&lt;p&gt;Here is a list of all the posts in the series so far.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/" target="_blank" rel="noopener"
 &gt;Introducing Power Query in Microsoft Flow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-microsoft-flow-2/" target="_blank" rel="noopener"
 &gt;Joining tables of data in Flow’s Power Query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-flow-3/" target="_blank" rel="noopener"
 &gt;Summarising Data in Flow’s Power Query&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="introduction"&gt;Introduction
&lt;/h3&gt;&lt;p&gt;Again this post might be redundant if you’ve followed my advice and found out your dba’s favourite biscuits and got them to write you some awesome views in the database.&lt;/p&gt;
&lt;p&gt;For those that haven’t got access to the dba lets look at how we can summarise the data. We will look at two different types of summarising the data, firstly grouping and then pivoting. I have assumed you’ve got your data into a simple table using merges etc.&lt;/p&gt;
&lt;h3 id="using-grouping"&gt;Using Grouping
&lt;/h3&gt;&lt;p&gt;In this example we will group by a column and include some summary values. We will group by Product and then summary values of count of orders, total quantity and total value.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Initial data" class="gallery-image" data-flex-basis="279px" data-flex-grow="116" height="584" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/Flow-PQ_201.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;This is how the data starts.&lt;/p&gt;
&lt;p&gt;On the toolbar click Transform Table and select Group By. We will start with a basic grouping of just one column to group by and one summary column of Order Count.&lt;/p&gt;
&lt;p&gt;I selected ProdName for the group by , entered a name for the summary column to give Order Count by counting the rows.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Basic Group by dialog" class="gallery-image" data-flex-basis="528px" data-flex-grow="220" height="309" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/Flow-PQ_202.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Simple group" class="gallery-image" data-flex-basis="352px" data-flex-grow="146" height="353" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/Flow-PQ_203.png" width="518"&gt;&lt;/p&gt;
&lt;p&gt;To add more columns to the summary I click on the cog wheel on the Grouped rows step to re-open the group by dialog.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Group by dialog" class="gallery-image" data-flex-basis="367px" data-flex-grow="153" height="444" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/Flow-PQ_204.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;I click on Advanced to open up options to add extra grouping and aggregation options. I click on Add aggregation to add extra columns and change Operation to Sum and Column to total up Qty and Value. Clicking OK updates the table.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Data grouped" class="gallery-image" data-flex-basis="626px" data-flex-grow="261" height="260" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/Flow-PQ_205.png" width="679"&gt;&lt;/p&gt;
&lt;h3 id="using-pivoting"&gt;Using Pivoting
&lt;/h3&gt;&lt;p&gt;Pivoting is a form of grouping that splits the data across a number of columns, for example total sales for each product across hours of the day. The first step is to reduce your table into just the data you need. So include the data for each row title, one set of data to be the column headings and one to be the data summarised.&lt;/p&gt;
&lt;p&gt;So I do Select Columns to reduce down to just Product, Hour of Sale and Qty of items sold.&lt;/p&gt;
&lt;p&gt;&lt;img alt="data ready to pivot" class="gallery-image" data-flex-basis="308px" data-flex-grow="128" height="482" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/Flow-PQ_206.png" width="620"&gt;&lt;/p&gt;
&lt;p&gt;Next, select the column of data that will make the column headings in your pivot. In my example I select the SaleHour column. Then from Transform Column, select Pivot Column.&lt;/p&gt;
&lt;p&gt;&lt;img alt="pivot column dialog" class="gallery-image" data-flex-basis="480px" data-flex-grow="200" height="340" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/Flow-PQ_207.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;In the Pivot column dialog, click on Advanced to reveal more options. In the Value column select the value you want to summarise and select the function you to use. Click OK to pivot the data.&lt;/p&gt;
&lt;p&gt;&lt;img alt="final pivot table after summarising the data" class="gallery-image" data-flex-basis="943px" data-flex-grow="393" height="173" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-flow-summarising-the-data/Flow-PQ_208.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion
&lt;/h3&gt;&lt;p&gt;Power Query provides a powerful way for summarising the data ready to process within the flow. As I stated earlier a view written by a dba would be more useful and quicker.&lt;/p&gt;</description></item><item><title>AI Builder Object Detect Model with Power Automate and Power Apps</title><link>https://hatfullofdata.blog/ai-builder-object-detect-model/</link><pubDate>Mon, 09 Sep 2019 09:38:06 +0000</pubDate><guid>https://hatfullofdata.blog/ai-builder-object-detect-model/</guid><description>&lt;p&gt;This series of posts is to introduce using an AI Builder Object detect model with Power Automate to get and save predictions and then display these predictions over the images in a Power App.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/ai-builder-with-flow-and-power-apps-building-the-model/" target="_blank" rel="noopener"
 &gt;Build the Model&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save Predictions&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use Predictions in a PowerApp&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="introduction"&gt;Introduction
&lt;/h3&gt;&lt;p&gt;In this post I will document building an AI Builder object detect model. We will create the list of items to detect, upload images, identify each image and then train and publish the model. I will be using 2 different types of Lego bricks, 1×2 block and 2×2 block.&lt;/p&gt;
&lt;p&gt;This post will be split into multiple parts&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create Entity to store object names&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create Model&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Upload and Tag images&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Train Model&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="create-entity-to-store-object-names"&gt;Create Entity to store object names
&lt;/h3&gt;&lt;p&gt;&lt;img alt="Create Entity" class="gallery-image" data-flex-basis="122px" data-flex-grow="51" height="1024" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-001.png" width="523"&gt;&lt;/p&gt;
&lt;p&gt;Before we can start building model we need to create a list of object names stored in the Common Data Store (CDS) in an entity. We need to create the entity and load object names.&lt;/p&gt;
&lt;p&gt;We start in Flow.Microsoft.com and then on the left hand menu click Data and then Entities.&lt;/p&gt;
&lt;p&gt;From the top ribbon select New entity which will open a pane on the right hand side. Enter a Display Name for the entity. It will complete the other fields for you.&lt;/p&gt;
&lt;p&gt;Click Create to create the entity.&lt;/p&gt;
&lt;p&gt;The next stage is to add data to the entity. The easiest way to do this is via Excel. Click on the Edit Data in Excel. A file will be downloaded which you need to open in Excel.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Entity screen" class="gallery-image" data-flex-basis="925px" data-flex-grow="385" height="176" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-002.png" width="679"&gt;&lt;/p&gt;
&lt;p&gt;You might need to enable the feature to get the pane to the feature in Excel. Enter in the Object Names and then click Publish to save the values to your entity.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Edit entity in Excel" class="gallery-image" data-flex-basis="477px" data-flex-grow="198" height="342" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-003.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Once the values have been published you can check back in your entity by back on the website and clicking on Data.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Show entity data" class="gallery-image" data-flex-basis="794px" data-flex-grow="331" height="205" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-004.png" width="679"&gt;&lt;/p&gt;
&lt;p&gt;If Excel won’t play ball, and for one client it just won’t, then you can use a very simple flow to add the entries.&lt;/p&gt;
&lt;h3 id="create-the-ai-builder-object-detect-model"&gt;Create the AI Builder Object Detect Model
&lt;/h3&gt;&lt;p&gt;On the left hand menu select AI Builder and then Build. The AI Builder currently offers 4 types of model. For this post we are going to build an Object detection model, so click on Object Detection. Then enter a name for your model and click Create.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Create the model" class="gallery-image" data-flex-basis="735px" data-flex-grow="306" height="222" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-005.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Name the model" class="gallery-image" data-flex-basis="346px" data-flex-grow="144" height="471" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-006.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="select-object-names"&gt;Select Object Names
&lt;/h3&gt;&lt;p&gt;The next stage in building the model, is to select the names to be used in the model. Click on select object names. From the panel select the entity you created and tick the Name column and click Select Fields.&lt;/p&gt;
&lt;p&gt;On the next screen select the values and click Next.&lt;/p&gt;
&lt;p&gt;&lt;img alt="pick names to use" class="gallery-image" data-flex-basis="671px" data-flex-grow="279" height="243" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-007.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="add-images"&gt;Add Images
&lt;/h3&gt;&lt;p&gt;After the object names have been selected you then need to add images for the model to be trained from. Click on the Add Images and this will open a file selection window, select files and click Open.&lt;/p&gt;
&lt;p&gt;On the next window it will show all the selected files. Click on Upload to start the upload. When the upload has completed click Close to move onto the next stage.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Add images to model" class="gallery-image" data-flex-basis="587px" data-flex-grow="244" height="278" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-008.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The next window will show you a summary of your uploads. You can click on +Add Images to add more images to improve your model. You need at least 15 images but more is recommended. Click Next to start tagging your images.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Summary of images in model" class="gallery-image" data-flex-basis="523px" data-flex-grow="217" height="312" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-009.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="tagging-images"&gt;Tagging Images
&lt;/h3&gt;&lt;p&gt;The next stage is tagging the images. I recommend a cup of tea, some music because this takes time.&lt;/p&gt;
&lt;p&gt;Click Next to start the tagging. Thumbnails of the images will be shown. Click on an image to enlarge that image and start the tagging. You can drag a box of an object or it will suggest objects with a white dotted box. Select the tag to apply.&lt;/p&gt;
&lt;p&gt;&lt;img alt="tag images in model" class="gallery-image" data-flex-basis="709px" data-flex-grow="295" height="230" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-010.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="tag objects in pictures in model" class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="383" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-011.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;On the right is a summary for this image and on the top ribbon you can choose to not use an image. When you click on the arrow it will move you onto the next image.&lt;/p&gt;
&lt;p&gt;When you have tagged all the images, click on Done Tagging in the top right hand corner.&lt;/p&gt;
&lt;h3 id="train-object-detect-model"&gt;Train Object Detect Model
&lt;/h3&gt;&lt;p&gt;When you click Next you get shown the details of your model so far. Click on the Train button to start the training.&lt;/p&gt;
&lt;p&gt;&lt;img alt="train the model" class="gallery-image" data-flex-basis="386px" data-flex-grow="161" height="422" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-012.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Training takes a while, the above one took 5 minutes to train. I assume its longer when there are more images and more tags. Eventually your list of models will show a time of being trained.&lt;/p&gt;
&lt;p&gt;&lt;img alt="training finished in model" class="gallery-image" data-flex-basis="728px" data-flex-grow="303" height="224" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-013.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The last step is to publish your object detect model. Click on the model name in the model list and it will show you a score for the training and give you a Publish button. Click the button to publish your model ready to use.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Published model" class="gallery-image" data-flex-basis="511px" data-flex-grow="213" height="319" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/ai-builder-object-detect-model/AI-Builder-014.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="conclusion-to-object-detect-model"&gt;Conclusion to Object Detect Model
&lt;/h3&gt;&lt;p&gt;This is a new feature still in preview, so it has its clunky parts, but it brings machine learning firmly into the hands of the citizen developer without any Azure bills.&lt;/p&gt;
&lt;p&gt;I really hope in 6 months time I need to write this post again because they’ve added new features and made it slightly less clunky.&lt;/p&gt;
&lt;h2 id="more-power-apps-posts"&gt;More Power Apps Posts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/powerapps-transparency-update/" target="_blank" rel="noopener"
 &gt;Transparency Update&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/" target="_blank" rel="noopener"
 &gt;Using JSON Feature to Save Pictures&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/ai-builder-object-detect-model/" target="_blank" rel="noopener"
 &gt;AI Builder Object Detect Model&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/powerapps-function-component/" target="_blank" rel="noopener"
 &gt;Function Component&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/powerapps-svg-introduction/" target="_blank" rel="noopener"
 &gt;SVG in Power Apps series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-apps-12-days-of-components/" target="_blank" rel="noopener"
 &gt;12 Days of Components&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-apps-build-a-responsive-app-planning/" target="_blank" rel="noopener"
 &gt;Build a Responsive App series&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-apps-embed-a-power-bi-chart/" target="_blank" rel="noopener"
 &gt;Embed a Power BI Chart&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Joining Tables of Data in Flow’s Power Query</title><link>https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/</link><pubDate>Fri, 06 Sep 2019 20:00:01 +0000</pubDate><guid>https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/</guid><description>&lt;p&gt;This is the second post in my series regarding Power Query in Flow. In this post I will introduce one of the most powerful parts of Power Query, joining tables. Its the vlookup part of Power Query.&lt;/p&gt;
&lt;p&gt;Here is a list of all the posts in the series so far.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/" target="_blank" rel="noopener"
 &gt;Introducing Power Query in Microsoft Flow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-microsoft-flow-2/" target="_blank" rel="noopener"
 &gt;Joining tables of data in Flow’s Power Query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-flow-3/" target="_blank" rel="noopener"
 &gt;Summarising Data in Flow’s Power Query&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="introduction"&gt;Introduction
&lt;/h3&gt;&lt;p&gt;If you have made best buddy friends with your dba (database administrator) then this post is possibly not required because if your dba will write a view to do the join for you, that is always better. BTW in my experience, dbas like biscuits.&lt;/p&gt;
&lt;p&gt;For those who don’t have access to their dba or haven’t bought enough biscuits this what we are going to do. My database contains a table called productsales.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Table of product sales" class="gallery-image" data-flex-basis="593px" data-flex-grow="247" height="275" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/Flow-PQ_101.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;In the Product Sales table is a ProductID column. I am going to use this value to merge in the values from the Product table (i.e. joining tables) so I can get the name and price.&lt;/p&gt;
&lt;p&gt;&lt;img alt="products" class="gallery-image" data-flex-basis="564px" data-flex-grow="235" height="289" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/Flow-PQ_102.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="multiple-tables"&gt;Multiple Tables
&lt;/h3&gt;&lt;p&gt;We start by adding both tables to our query. If multiple tables are in a query, Power Query only returns one table. You can tell which table will be returned by looking at the list of tables. The tables with italic names will not be returned, therefore the un-italicised table will be returned.&lt;/p&gt;
&lt;p&gt;&lt;img alt="select query to load" class="gallery-image" data-flex-basis="699px" data-flex-grow="291" height="233" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/Flow-PQ_103.png" width="679"&gt;&lt;/p&gt;
&lt;p&gt;Right click on a table name to open the menu. Then select Enable Load to change the table that will be loaded. In this example I will select that productsales will be loaded.&lt;/p&gt;
&lt;h3 id="merging-tables"&gt;Merging tables
&lt;/h3&gt;&lt;p&gt;We want to add the product name and product price to product sales tables. We will do this by merging the two tables.&lt;/p&gt;
&lt;p&gt;Select the productsales table. Then from the toolbar, select Combine Tables and Merge Queries.&lt;/p&gt;
&lt;p&gt;&lt;img alt="merge queries" class="gallery-image" data-flex-basis="269px" data-flex-grow="112" height="360" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/Flow-PQ_105.png" width="404"&gt;&lt;/p&gt;
&lt;p&gt;In the Merge dialog that appears select table you wish to merge with in the drop down, in my example I select products table. Then click on the columns that match, in my example I select product id in both tables.&lt;/p&gt;
&lt;p&gt;&lt;img alt="merge dialog box" class="gallery-image" data-flex-basis="208px" data-flex-grow="86" height="783" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/Flow-PQ_104-2.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Leave the join kind as Left Outer as this will keep all the sales records and find matching products. Further details of join types can be found on Radacad’s site. &lt;a class="link" href="https://radacad.com/choose-the-right-merge-join-type-in-power-bi" target="_blank" rel="noopener"
 &gt;https://radacad.com/choose-the-right-merge-join-type-in-power-bi&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="expanding-the-table-column"&gt;Expanding the table column
&lt;/h3&gt;&lt;p&gt;Clicking OK will update the table to include a column which contains Tables.&lt;/p&gt;
&lt;p&gt;&lt;img alt="expand table column" class="gallery-image" data-flex-basis="470px" data-flex-grow="195" height="347" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/Flow-PQ_106.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Click on the icon in top right of the new column to display the columns available in the tables. Unselect any un-required columns. Unselect the Use original column name as prefix to prevent the new columns being named long names for example products.ProdName. Then click OK to add the new columns.&lt;/p&gt;
&lt;p&gt;&lt;img alt="final data after joining tables" class="gallery-image" data-flex-basis="553px" data-flex-grow="230" height="295" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-joining-tables/Flow-PQ_107.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="conclusion-to-joining-tables"&gt;Conclusion to Joining Tables
&lt;/h3&gt;&lt;p&gt;Merging is a powerful addition to transforming data. It is better if a view can added to the database by your dba as that will always be more efficient. Power Query merges do offer a great alternative.&lt;/p&gt;</description></item><item><title>Power Query in Microsoft Flow – An Introduction</title><link>https://hatfullofdata.blog/power-query-in-microsoft-flow-1/</link><pubDate>Mon, 26 Aug 2019 21:34:42 +0000</pubDate><guid>https://hatfullofdata.blog/power-query-in-microsoft-flow-1/</guid><description>&lt;p&gt;This is the first post in a new series regarding Power Query in Microsoft Flow. In this post I will cover the basics of connecting to SQL Server and using Power Query to filter and sort the data and finally add calculated columns.&lt;/p&gt;
&lt;p&gt;This series assumes that you are not a user of Power Query desktop from Excel or Power BI.&lt;/p&gt;
&lt;p&gt;Here is a list of all the posts in the series so far.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/" target="_blank" rel="noopener"
 &gt;Introducing Power Query in Microsoft Flow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-microsoft-flow-2/" target="_blank" rel="noopener"
 &gt;Joining tables of data in Flow’s Power Query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://hatfullofdata.blog/power-query-in-flow-3/" target="_blank" rel="noopener"
 &gt;Summarising Data in Flow’s Power Query&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="introduction-to-power-query-in-microsoft-flow"&gt;Introduction to Power Query in Microsoft Flow
&lt;/h3&gt;&lt;p&gt;In September 2018 Microsoft announced the integration of Power Query Online for Microsoft Flow. The reasons were to offer an alternative to OData and SQL for getting data from SQL Server connector. They included a hint that other data sources will come in the future but no details when or what.&lt;/p&gt;
&lt;p&gt;For those coming from Power Query for Excel or Power BI you need to understand you are currently limited to data stored in SQL Server online or server via a gateway. Also the Power Query Online environment is not as powerful as the desktop app version. It is still written in M, so you can do many of the transformations you can in Excel and Power BI’s Power Query.&lt;/p&gt;
&lt;h3 id="connecting-to-the-database"&gt;Connecting to the Database
&lt;/h3&gt;&lt;p&gt;Our first action is to connect Power Query to the data. Power Query action is from the SQL Server connector.&lt;/p&gt;
&lt;p&gt;&lt;img alt="sql server connection" class="gallery-image" data-flex-basis="462px" data-flex-grow="192" height="353" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_001.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;If this is the first time you’ve connected to the database you will be prompted for database details and the user id to use with a password.&lt;/p&gt;
&lt;p&gt;&lt;img alt="authentication and settings" class="gallery-image" data-flex-basis="292px" data-flex-grow="122" height="557" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_002.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Then the action then changes to just show a button. This means you have connected to the database successfully.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Successful connection to power query in microsoft flow" class="gallery-image" data-flex-basis="1255px" data-flex-grow="523" height="130" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_004.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="selecting-data-to-transform"&gt;Selecting Data to Transform
&lt;/h3&gt;&lt;p&gt;When you click the Edit Query button for the first time, you will be presented with the tables and views in the database. You need to tick the tables and views that you need. For this post I’m just going select a single table Expenses and then click Next.&lt;/p&gt;
&lt;p&gt;&lt;img alt="select tables" class="gallery-image" data-flex-basis="457px" data-flex-grow="190" height="357" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_005.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The next window is the main Online Power Query window, where we will add steps to transform your data.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;List of parameters and tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;View of the data at the current step&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;List of steps&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Toolbar used to add new steps&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt="power query window" class="gallery-image" data-flex-basis="455px" data-flex-grow="189" height="358" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_006.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="filtering-data"&gt;Filtering Data
&lt;/h3&gt;&lt;p&gt;One of the most common requests on data is to filter the values. Clicking on the arrow next to column header will show you a list of values with tick boxes. Un-tick the unrequired values to filter your data. When you do this it will add a new step to the applied steps.&lt;/p&gt;
&lt;p&gt;&lt;img alt="filtering" class="gallery-image" data-flex-basis="439px" data-flex-grow="183" height="371" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_007.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;When you want to change the filtered value, you need to click the cog wheel next to the step. You can click on X to remove any step.&lt;/p&gt;
&lt;h3 id="sorting-data"&gt;Sorting Data
&lt;/h3&gt;&lt;p&gt;When you click the drop down arrow next the column heading, you can select Sort ascending or Sort descending. The first time you select sort, the data gets sorted and a new step is added to the applied steps.&lt;/p&gt;
&lt;p&gt;If you then sort another column, the existing step is just extended to add the next column to the sort. This is similar to adding a new sort level in Excel.&lt;/p&gt;
&lt;p&gt;&lt;img alt="sorting" class="gallery-image" data-flex-basis="1337px" data-flex-grow="557" height="122" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_008.png" width="680"&gt;&lt;/p&gt;
&lt;h3 id="adding-columns"&gt;Adding Columns
&lt;/h3&gt;&lt;p&gt;One of the most powerful parts of Power Query is to add columns using calculations. The interface can be really clever and also limited and drives me nuts which is perhaps a blog post all of its own.&lt;/p&gt;
&lt;p&gt;If you select a column and then click Add Column from the top ribbon you will get offered choices based on the column type. For example, if you have selected a number column you get offered Standard, Scientific and Trigonometry functions and rounding plus others.&lt;/p&gt;
&lt;p&gt;&lt;img alt="adding column" class="gallery-image" data-flex-basis="454px" data-flex-grow="189" height="359" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_009.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The result of the calculation is placed in a new column.&lt;/p&gt;
&lt;p&gt;&lt;img alt="column added" class="gallery-image" data-flex-basis="676px" data-flex-grow="281" height="241" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_010.png" width="679"&gt;&lt;/p&gt;
&lt;p&gt;When you select multiple columns before selecting Add column, calculations to combine the columns are offered, such as difference between dates.&lt;/p&gt;
&lt;h3 id="renaming-and-selecting-columns"&gt;Renaming and Selecting Columns
&lt;/h3&gt;&lt;p&gt;You can rename any column by double clicking on the column header and typing in a new name. The first column you rename will add a new step to the query. If you rename another column straight after the Renamed Columns step is extended.&lt;/p&gt;
&lt;p&gt;It is always a good idea to only return the columns that are required by the Flow. Under Manage Columns you can select Choose columns. When the dialog is selected, you can tick or un-tick any column.&lt;/p&gt;
&lt;p&gt;&lt;img alt="choosing columns" class="gallery-image" data-flex-basis="283px" data-flex-grow="118" height="576" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/power-query-in-microsoft-flow-1/Flow-PQ_011.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The choose columns step has a cog wheel so can be modified at any point. I recommend you use this step rather than delete columns as that cannot be tweaked using the cog wheel.&lt;/p&gt;
&lt;h3 id="finishing"&gt;Finishing
&lt;/h3&gt;&lt;p&gt;When you have finished transforming your data you can click Create on a new query or Update if you are editing an existing query. You can now use the data returned just as you would for getting items from any source.&lt;/p&gt;
&lt;h3 id="resources-for-power-query-in-microsoft-flow"&gt;Resources for Power Query in Microsoft Flow
&lt;/h3&gt;&lt;p&gt;As always there are a selection of resources out on the web.&lt;/p&gt;
&lt;p&gt;•Microsoft &lt;a class="link" href="https://flow.microsoft.com/en-us/blog/powerquery-flow/" target="_blank" rel="noopener"
 &gt;https://flow.microsoft.com/en-us/blog/powerquery-flow/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Chris Webb&lt;a class="link" href="https://blog.crossjoin.co.uk/2018/09/26/using-power-query-and-microsoft-flow-to-automate-the-creation-of-csv-files/" target="_blank" rel="noopener"
 &gt;https://blog.crossjoin.co.uk/2018/09/26/using-power-query-and-microsoft-flow-to-automate-the-creation-of-csv-files/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Erik Svensen&lt;a class="link" href="https://eriksvensen.wordpress.com/2018/09/25/powerquery-everywhere-now-in-microsoftflow-as-well/" target="_blank" rel="noopener"
 &gt;https://eriksvensen.wordpress.com/2018/09/25/powerquery-everywhere-now-in-microsoftflow-as-well/&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion
&lt;/h3&gt;&lt;p&gt;Power Query is a great addition to the Flow tool set. I am really hoping for more data sources to be allowed and for the online Power Query to include more features from the desktop version.&lt;/p&gt;
&lt;p&gt;This is just an introduction so I will include best practices and further features.&lt;/p&gt;</description></item><item><title>Power Automate – Creating Adaptive Cards</title><link>https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/</link><pubDate>Wed, 07 Aug 2019 07:09:31 +0000</pubDate><guid>https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/</guid><description>&lt;p&gt;This post is to support a video posted on YouTube regarding creating adaptive cards for Microsoft Teams using Power Automate.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.youtube.com/watch?v=nGEh04HAQsw" target="_blank" rel="noopener"
 &gt;&lt;img alt="YouTube Thumbnail" class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="270" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/youtube.jpg" width="480"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="designing-an-adaptive-card"&gt;Designing an Adaptive Card
&lt;/h2&gt;&lt;p&gt;Before you can post an adaptive card to a team you need to design the card. Cards are designed online on an interactive website that will build the JSON definition for you. In this post we will create a very simple card.&lt;/p&gt;
&lt;p&gt;::: info Instructions&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Visit &lt;a class="link" href="https://adaptivecards.io/" target="_blank" rel="noopener"
 &gt;https://adaptivecards.io/&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on Designer on the top navigation&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on New Card&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Drag TextBlock elements from the options on the left into the Card. Double
click on the text to change the text.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make changes to the layout and style as required. The JSON defining the card will be updated.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click Copy card JSON to copy the code to the clipboard.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;p&gt;&lt;img alt="Creating adaptive cards" class="gallery-image" data-flex-basis="430px" data-flex-grow="179" height="379" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/IntroCard_01.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Other elements could be added to the card and formatted as required.&lt;/p&gt;
&lt;h2 id="writing-the-flow"&gt;Writing the Flow
&lt;/h2&gt;&lt;p&gt;For this post the flow is going to be very simple. I start by adding a button trigger with a single string input called Message.&lt;/p&gt;
&lt;p&gt;&lt;img alt="manually trigger with message" class="gallery-image" data-flex-basis="803px" data-flex-grow="334" height="203" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/IntroCard_02.jpg" width="680"&gt;&lt;/p&gt;
&lt;p&gt;Under the Teams connector, I find the Post your own adaptive card as the Flow bot to a channel. I select the Team and Channel that I want the message to go to.&lt;/p&gt;
&lt;p&gt;In the message I paste the Adaptive cards code copied earlier. I double click on the MESSAGE and then click in the Dynamic Content pane on Message to replace the text.&lt;/p&gt;
&lt;p&gt;&lt;img alt="edit adaptive card" class="gallery-image" data-flex-basis="423px" data-flex-grow="176" height="385" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/IntroCard_03.jpg" width="680"&gt;&lt;/p&gt;
&lt;h2 id="running-the-flow"&gt;Running the Flow
&lt;/h2&gt;&lt;p&gt;The flow can be run from your phone and the Flow app. Typing in a message will add the card to the channel in Teams.&lt;/p&gt;
&lt;p&gt;&lt;img alt="run the flow" class="gallery-image" data-flex-basis="432px" data-flex-grow="180" height="377" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/microsoft-flow-creating-adaptive-cards/IntroCard_04.jpg" width="680"&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;This is a very simple example of an adaptive card being posted in Teams. The possibilities are endless and are a great next step up from sending email notifications to multiple people.&lt;/p&gt;</description></item><item><title>PowerApps – Using JSON Function to Save Pictures</title><link>https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/</link><pubDate>Mon, 08 Jul 2019 10:21:38 +0000</pubDate><guid>https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/</guid><description>&lt;img src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_10.png" alt="Featured image of post PowerApps – Using JSON Function to Save Pictures" /&gt;&lt;p&gt;In this post I will be explaining how to use the JSON Function to simplify the saving of multiple pictures from a PowerApp to a SharePoint library using Flow. There have been many wonderful workarounds to do this, finally we now have a slightly less Heath-Robinson method.&lt;/p&gt;
&lt;h2 id="set-up-the-powerapp"&gt;Set up the PowerApp
&lt;/h2&gt;&lt;p&gt;I start with a blank app, canvas or phone layout. Because my main client uses Windows 10 tablet / laptops to take the pictures I add a camera control. Then I change the OnSelect property to store the picture into a collection. I include an index column so Flow can calculate a unique filename later.&lt;/p&gt;
&lt;p&gt;&lt;img alt="camera onselect action" class="gallery-image" data-flex-basis="502px" data-flex-grow="209" height="325" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_01-3.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;I then add a blank gallery and change the Items to be the collection populated by the camera, e.g. ccPictures and to make a grid I change the wrap to be 3. I add an Image control to the gallery so as I take pictures it will populate the grid.&lt;/p&gt;
&lt;p&gt;&lt;img alt="gallery settings" class="gallery-image" data-flex-basis="138px" data-flex-grow="57" height="1024" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_02.png" width="591"&gt;&lt;/p&gt;
&lt;p&gt;Then I take some pictures to populate my collection. Obviously everyone needs photos of their Lego character collection.&lt;/p&gt;
&lt;p&gt;&lt;img alt="lego pictures" class="gallery-image" data-flex-basis="762px" data-flex-grow="317" height="214" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_03-1.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;In order for the pictures to be passed to Flow to be saved to SharePoint I need to convert the collection into JSON. So I add a button with the following code. Please note the second parameter of the JSON function is IncludeBinaryData as we want to include the pictures which are binary data.&lt;/p&gt;
&lt;p&gt;&lt;img alt="save pictures button on select" class="gallery-image" data-flex-basis="662px" data-flex-grow="276" height="246" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_04.png" width="679"&gt;&lt;/p&gt;
&lt;h2 id="building-the-flow"&gt;Building the Flow
&lt;/h2&gt;&lt;p&gt;In the previous section, I created the app to make the JSON string to be processed by a Flow. So I now I will create a new flow with a PowerApp trigger.&lt;/p&gt;
&lt;p&gt;The first step to add is a Parse JSON action to convert the JSON into an array. In order for the parameter requested by Flow to be named nicely I rename the step to just “JSON” and then in the Content box I click on Ask in PowerApps. Now the parameter is called JSON_Content. Afterwards you can rename the action back to Parse JSON and it won’t rename the parameter.&lt;/p&gt;
&lt;p&gt;&lt;img alt="parse json" class="gallery-image" data-flex-basis="396px" data-flex-grow="165" height="412" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_05.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;For the Schema you need to understand JSON a little. The JSON you return will be multiple rows each with 2 columns, Picture which is a string and Index which is a number. So in a text editor I create small example JSON string with multiple rows of data and copy it.&lt;/p&gt;
&lt;p&gt;&lt;img alt="example json" class="gallery-image" data-flex-basis="823px" data-flex-grow="342" height="198" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_06.png" width="679"&gt;&lt;/p&gt;
&lt;p&gt;Then in the Parse JSON action I click on Use sample payload to generate schema and I paste my example in, clicking Done will create the schema.&lt;/p&gt;
&lt;p&gt;&lt;img alt="parse json with schema" class="gallery-image" data-flex-basis="428px" data-flex-grow="178" height="381" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_07.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The next step is for every item in the array to save a picture. So we start with an Apply to each action which will use the Body from the Parse JSON step.&lt;/p&gt;
&lt;p&gt;Then we add a SharePoint action to Create file. Site address and path you will need to get from the SharePoint destination. The File Name I create using the Index value.&lt;/p&gt;
&lt;p&gt;The File Content uses an Expression. So click on Expression and find the function decodeDataUri. The parameter for the function is the Picture value, which doesn’t appear in the offered Dynamic content, so we need to use the Item() function and then add ?[‘Picture’].&lt;/p&gt;
&lt;p&gt;&lt;img alt="creating the image file" class="gallery-image" data-flex-basis="597px" data-flex-grow="249" height="273" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_08.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="connecting-powerapp-to-the-flow"&gt;Connecting PowerApp to the Flow
&lt;/h2&gt;&lt;p&gt;We now have a Flow ready to receive JSON data and save pictures. So we now just need to connect them. In my experience adding a flow to a button that already has code does not end well, I usually loose the existing code. So I add a second button and from the Action ribbon click Flows and connect up my Flow and pass in as the parameter the variable containing the JSON, e.g. vvJSON. Then I copy and paste this code into the button that creates the JSON string.&lt;/p&gt;
&lt;p&gt;&lt;img alt="connect powerapp with json function to file" class="gallery-image" data-flex-basis="523px" data-flex-grow="217" height="312" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_09.png" width="680"&gt;&lt;/p&gt;
&lt;p&gt;The app is now ready to test.&lt;/p&gt;
&lt;p&gt;&lt;img alt="images in library" class="gallery-image" data-flex-basis="464px" data-flex-grow="193" height="351" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://hatfullofdata.blog/powerapps-using-json-function-to-save-pictures/JSONPicture_10.png" width="680"&gt;&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;The above solution is a very simple example of how the JSON function could be used. Before this went into production I would do better file naming. I have tested the above app to take 30 photos and save them to SharePoint and it worked fine. I assume there is a limit to the size of the JSON.&lt;/p&gt;
&lt;p&gt;The JSON function does allow a whole collection to be passed to Flow easily. I will be looking for other possible uses.&lt;/p&gt;</description></item></channel></rss>