Power Automate
https://dynamics-chronicles.com/
enPower Docu : Easy to document Dataverse Solution
https://dynamics-chronicles.com/article/power-docu-easy-document-dataverse-solution
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Power Docu : Easy to document Dataverse Solution</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/joaoneto" lang="" about="/user/joaoneto" typeof="schema:Person" property="schema:name" datatype="" class="username">joao.neto</a></span>
<span property="schema:dateCreated" content="2024-03-14T13:45:19+00:00" class="field field--name-created field--type-created field--label-hidden">Thu, 03/14/2024 - 14:45</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><h1>Intro</h1>
<p>Want to document a Power Apps Solution?</p>
<p>Power Docu provides a easy way of doing it by documenting Flows, Canvas Apps and other Power Apps solution components in the form of a Word Document or in a markdown format (GitHub or Azure Devops style) by using an self contained Windows Gui application.</p>
<p>All info over this link here: <a href="https://github.com/modery/PowerDocu">https://github.com/modery/PowerDocu</a></p>
<h1>How it Works</h1>
<p>Power Docu support the generation of documentation for Power Apps based on a local solution .zip or on a .msapp file.</p>
<p>The documentation contains information about :</p>
<ul>
<li>Power Automate Flows
<ul>
<li>General information</li>
<li>Connectors</li>
<li>Trigger</li>
<li>Actions</li>
<li><img alt="Flow Actions" data-entity-type="file" data-entity-uuid="99f325f8-b758-4918-89b2-959a117c0113" height="458" src="/sites/default/files/inline-images/PowerDocu.Flow_.Action.png" width="469" /></li>
<li>Flow diagram (simple and detailed)</li>
<li><img alt="Simple Flow Diagram" data-entity-type="file" data-entity-uuid="c8080098-b754-40f7-aaa6-c0f8a20697e6" height="441" src="/sites/default/files/inline-images/flow.png" width="242" /></li>
<li><img alt="Detailed Flow Diagram" data-entity-type="file" data-entity-uuid="b34c84d5-a97e-42ef-9dd8-6d0d37da4be2" height="489" src="/sites/default/files/inline-images/flow-detailed.png" width="826" /></li>
</ul>
</li>
<li>Canvas Apps
<ul>
<li>General information</li>
<li>Global variables</li>
<li><img alt="Canvas Variables" data-entity-type="file" data-entity-uuid="3b2f1b05-56cb-4966-ad32-489a09ca7c23" height="183" src="/sites/default/files/inline-images/PowerDocu.CanvasApps.Variables.png" width="471" /></li>
<li>Data sources</li>
<li>Resources</li>
<li>Controls</li>
<li><img alt="Canvas Controls" data-entity-type="file" data-entity-uuid="32003bed-d0b5-414f-b30b-71e927765643" height="295" src="/sites/default/files/inline-images/PowerDocu.CanvasApps.Controls_0.png" width="439" /></li>
<li>Screens overview</li>
</ul>
</li>
<li>Solution components
<ul>
<li>Dataverse Tables
<ul>
<li>Columns</li>
<li>Relationships</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><img alt="Tables" data-entity-type="file" data-entity-uuid="e95e59f8-76c3-41ee-bbde-542b1fa4eff8" height="386" src="/sites/default/files/inline-images/PowerDocu.DocTables.png" width="418" /></p>
<ul>
<li>Security Roles</li>
</ul>
<p><img alt="Security Roles" data-entity-type="file" data-entity-uuid="93a40987-7267-4ebe-bf85-a6470e564917" height="463" src="/sites/default/files/inline-images/PowerDocu.DocSecRoles.png" width="412" /></p>
<ul>
<li>Solution Dependencies</li>
</ul>
<p><img alt="Solution Dependencies" data-entity-type="file" data-entity-uuid="e67d122e-c0aa-4d87-93b3-1c5cbf288a37" height="392" src="/sites/default/files/inline-images/PowerDocu.DocDependencies.png" width="446" /></p>
<p>By the way Model Driven-Apps aren't yet support in the current version 2.0 !</p>
<h1>How to</h1>
<ul>
<li>Install Power Docu locally</li>
<li>Run Power Docu</li>
</ul>
<p><img alt="App" data-entity-type="file" data-entity-uuid="d49b1193-6a66-4b0e-8173-1a4a57ca7de9" height="369" src="/sites/default/files/inline-images/PowerDocu.01.png" width="587" /></p>
<ul>
<li>Select the outputs</li>
</ul>
<p><img alt="Outputs" data-entity-type="file" data-entity-uuid="62378785-1446-47a9-bf5a-17bdaccae9fc" height="140" src="/sites/default/files/inline-images/PowerDocu.Output.png" width="284" /></p>
<ul>
<li>Select the Canvas App documentation level</li>
</ul>
<p><img alt="Canvas Options" data-entity-type="file" data-entity-uuid="0cebabe6-2840-4945-97c4-d98cdbbe4701" height="156" src="/sites/default/files/inline-images/PowerDocu.CanvasApps.png" width="398" /></p>
<ul>
<li>Click "Next" and select a solution export file on a .zip or on a .msapp file format</li>
</ul>
<p><img alt="Open Solution" data-entity-type="file" data-entity-uuid="bf95d75c-6ba7-432f-a646-21efc43f8d21" height="424" src="/sites/default/files/inline-images/PowerDocu.OpenFile.png" width="589" /></p>
<ul>
<li>Your Documentation is ready on the same folder as you solution file!</li>
</ul>
<h1>Final thoughts</h1>
<p>Power Docu it's a very interesting App to easily generate standard Documentation for you Power Apps solution.</p>
<p>In my perspective just missing the Model-Driven Apps module that I would really use and just noticed that it's on the project Roadmap !</p>
<p>The code is open source so teams can fork and build their own generation model.</p>
<p> </p>
<p> </p>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2024-07/PowerDocu%20-%20Info%20Header.png</div>
</div>
</div>
</div>
</div>
Thu, 14 Mar 2024 13:45:19 +0000joao.neto768 at https://dynamics-chronicles.comStreamlining Development in Dynamics 365 F&O with Unified Developer Environments
https://dynamics-chronicles.com/article/streamlining-development-dynamics-365-fo-unified-developer-environments
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Streamlining Development in Dynamics 365 F&O with Unified Developer Environments</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/lloyd-sebag" lang="" about="/user/lloyd-sebag" typeof="schema:Person" property="schema:name" datatype="" class="username">Lloyd Sebag</a></span>
<span property="schema:dateCreated" content="2023-09-20T14:26:11+00:00" class="field field--name-created field--type-created field--label-hidden">Wed, 09/20/2023 - 16:26</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>Streamlining Development in Dynamics 365 F&O with Unified Developer Environments</em></p>
<p>In the world of finance and operations, the complexity of developer tools and environments can often hinder productivity and collaboration. Recognizing this challenge, Microsoft has introduced a Unified Developer Experience aimed at consolidating and simplifying the developer journey across finance and operations apps and Power Platform. This transformative approach promises to reduce friction and accelerate development processes. In this article, we'll delve into the key aspects of this unified experience and explore its benefits.</p>
<h3><strong>Unified Developer Experience Explained</strong></h3>
<p>The Unified Developer Experience bridges the gap between finance and operations apps and Power Platform, offering a cohesive environment for developers. This convergence aims to streamline development, making it easier to work across these platforms seamlessly. Let's break down some essential components of this unified approach:</p>
<ol>
<li>
<p><strong>Finance and Operations Apps:</strong> These applications provide a robust ecosystem for professional developers. Leveraging a metadata and code-based development environment, they cater to mission-critical scenarios. Developers can create, extend, and customize functionalities to meet specific business needs.</p>
</li>
<li>
<p><strong>Power Platform:</strong> Power Platform offers a low-code development paradigm, allowing rapid solution creation. Microsoft Dataverse serves as the relational data store, ensuring data consistency and availability. Additionally, Power Platform integrates continuous integration and deployment (CI/CD) pipelines for efficient solution deployment.</p>
</li>
</ol>
<h3><strong>A Typical Scenario</strong></h3>
<p>To illustrate the benefits of this unified experience, consider a common scenario: a developer building a simple app in Microsoft Power Apps for order capture. The data collected in Power Apps is seamlessly synchronized with finance and operations apps. These finance and operations apps handle intricate tasks like inventory availability checks and pricing calculations. The result? Real-time data availability in Power Apps.</p>
<h3><strong>Finance and Operations App Development</strong></h3>
<p>Developers working with finance and operations apps will find familiarity in the Visual Studio development environment. While some changes have been introduced due to the cloud-based nature of this unified environment, most workflows remain consistent. Resources like the "Write, deploy, and debug X++ code" guide help developers navigate X++ code development, deployment, and debugging in the cloud.</p>
<h3><strong>Power Platform Integration</strong></h3>
<p>Power Platform's rich development ecosystem complements the unified experience. The Dataverse relational database system plays a pivotal role, facilitating data synchronization between finance and operations app databases and Dataverse entities. Two technologies, dual-write and virtual entities, enable this integration:</p>
<ul>
<li>
<p><strong>Dual Write:</strong> Dual Write ensures near real-time, bidirectional data integration between finance and operations apps and Dataverse. Changes made in one system automatically reflect in the other. This synchronization is complemented by an advanced user interface for customization.</p>
</li>
<li>
<p><strong>Virtual Tables:</strong> Virtual tables, or virtual entities, seamlessly integrate external data sources with Dataverse, eliminating the need for data replication or extensive custom coding.</p>
</li>
</ul>
<h3><strong>Deployment Options</strong></h3>
<p>Historically, finance and operations app customers had two deployment options: self-hosted virtual machines on-premises or customer-provided Azure subscriptions. However, recognizing the need for faster and low-code extensibility, Microsoft has introduced new deployment options:</p>
<p><strong>New Environment Templates:</strong> Customers can now access environment templates in the Power Platform admin center for Finance, Supply Chain Management, and Project Operations for ERP. These templates come pre-configured with Dataverse and related apps, simplifying deployment.</p>
<p><img alt="Streamlining Development in Dynamics 365 F&O with Unified Developer Environments" data-entity-type="file" data-entity-uuid="cea030b7-0179-4ec5-aefd-fd08fda1f85a" height="298" src="/sites/default/files/inline-images/1_32.png" width="244" /></p>
<p><strong>Storage-Based Provisioning:</strong> The new unified developer environments follow a storage-based provisioning model, which doesn't bill to your Azure subscription. It includes Dataverse and Finance and Operations database capacity management.</p>
<p><img alt="Streamlining Development in Dynamics 365 F&O with Unified Developer Environments" data-entity-type="file" data-entity-uuid="f28a6f4b-4543-4b8c-997f-660367ef8098" height="721" src="/sites/default/files/inline-images/2_30.png" width="613" /></p>
<h3><strong>Enhanced Capabilities for Administrators and Developers</strong></h3>
<p>Administrators can now deploy environments at scale, copy environments directly, add developers with permissions, incorporate microservice add-ins, enable customer-managed keys, and more. Developers benefit from a simplified process for writing and deploying X++ alongside Dataverse solutions.</p>
<h3><strong>Getting Started</strong></h3>
<p>To explore this Unified Developer Experience, read the "Unified admin experience for finance and operations apps" article for provisioning developer and trial workloads. Microsoft encourages users to provide feedback and engage with the Dynamics 365 Community to shape future developments.</p>
<p>In conclusion, Microsoft's Unified Developer Experience is a game-changer for finance and operations app developers. By harmonizing developer tools and environments, it simplifies workflows, accelerates development, and empowers developers to create powerful solutions seamlessly. With new deployment options and enhanced capabilities, the future looks promising for finance and operations app development.</p>
<p>Sources : </p>
<p><a href="https://cloudblogs.microsoft.com/dynamics365/it/2023/09/15/announcing-unified-trial-and-developer-environments-for-dynamics-365-finance-and-operations-apps/">https://cloudblogs.microsoft.com/dynamics365/it/2023/09/15/announcing-unified-trial-and-developer-environments-for-dynamics-365-finance-and-operations-apps/</a></p>
<p><a href="https://learn.microsoft.com/en-us/power-platform/developer/unified-experience/finance-operations-dev-overview">https://learn.microsoft.com/en-us/power-platform/developer/unified-experience/finance-operations-dev-overview</a></p>
<h2 class="title">Streamlining Development in Dynamics 365 F&O with Unified Developer Environments</h2>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2023-09/Streamlining%20Development%20in%20Dynamics%20365%20Finance%20and%20Operations%20with%20Unified%20Developer%20Environments.jpg</div>
</div>
</div>
</div>
</div>
Wed, 20 Sep 2023 14:26:11 +0000Lloyd Sebag712 at https://dynamics-chronicles.comError handling in Power Automate flows
https://dynamics-chronicles.com/article/error-handling-power-automate-flows
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Error handling in Power Automate flows</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/sergio-ferraresi" lang="" about="/user/sergio-ferraresi" typeof="schema:Person" property="schema:name" datatype="" class="username">Sergio Ferraresi</a></span>
<span property="schema:dateCreated" content="2023-05-30T08:22:56+00:00" class="field field--name-created field--type-created field--label-hidden">Tue, 05/30/2023 - 10:22</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>Error handling in Power Automate flows</em></p>
<p><span><span><span>Low Code solutions using Power Automate flows are becoming more and more popular in CRM Dynamics projects. But often low code solutions show maintenance issues because of the tendency of the developers (myself included of course) to neglect the exception </span></span></span><span><span><span>handling aspects of the power automate flows under the assumption that</span></span></span><span><span><span> "low code" also means "low error handling". </span></span></span></p>
<h3>Our objectives</h3>
<p>With this article I will cover the topic of how to handle errors in Power Automate flows and how to track them for a later analysis of them. What we need to achieve is a way of:</p>
<ol>
<li>capturing the errors that have been raised</li>
<li>identifying the action that has failed</li>
<li>getting a description of the reason for this failure</li>
</ol>
<p>Let's get started.</p>
<h3>Out-of-the-box features: some limitations</h3>
<p>We will first have a look at the out-of-the-box features offered by Power Automate to check the flow executions.</p>
<p>When you need to verify when a flow has run and whether the flow execution was successful or not, you open the flow and you are presented a run history reporting the flow executions of the flow in the last 28-days:</p>
<p><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="ca4bd658-64a5-444f-9d70-6fc6f79ffb27" src="/sites/default/files/inline-images/2023-05-07%2015_57_06-Remote%20Desktop%20Web%20Client.png" /></p>
<p>In this view you do not get any details about the reason for the failure. You need to open the specific execution that failed by double clicking on it and you get the reason for the failure in the "Error Details" pane on the right hand side of the run view.</p>
<h4><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="18ae0f4c-c314-4177-bd1d-9445e25cc7ac" height="473" src="/sites/default/files/inline-images/2023-05-08%2017_34_15-Phoenix%20Project%20Survey%20-%20Message%20%28HTML%29.png" width="939" /></h4>
<p>This way of inspecting the errors requires a periodical check of the flow executions: a time consuming action that can be easily avoided with the following solution.</p>
<h3>Handling errors occurring in one action</h3>
<p>Let's suppose to have a flow responsible for updating the owning team of an account according to the country where the company is based in.</p>
<p>We are going to trigger the flow when a new account is created or when its address is modified.</p>
<p>If the company address contains a USA address, the flow assigns the company to the USA Team, otherwise it will be assign to the Non-USA Team.</p>
<p>The flow structure is the following one:</p>
<p><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="7295cb59-06f2-4d15-9c06-d88929ca4026" height="477" src="/sites/default/files/inline-images/2023-05-08%2018_07_28-Phoenix%20Project%20Survey%20-%20Message%20%28HTML%29.png" width="922" /></p>
<p>If the update of the account owning team is successfully performed we want to send an email to confirm the successful assignment of its owner.</p>
<p>We also want to handle possible problems occurring in the update action called "<em>Update Account owning team</em>": in case an issue occurs while updating the account, we do not want the email to be sent, instead we want to catch the error, get its details and log the error for a later analysis.</p>
<p>At the moment we suppose to log the error in the Dataverse: I created a custom table called "Error Log" with the needed fields to store the error details. I will propose a slightly different solution later in the article.</p>
<p>The first thing we need to do to handle the update errors is to create a parallel branch after the update action as shown below.</p>
<p><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="21c167ae-ccfd-4683-85cf-d6bbbd9921e7" height="437" src="/sites/default/files/inline-images/2023-05-08%2017_52_29-Power%20Apps%20_%20Flows.png" width="925" /></p>
<p>After adding the branch we will have two actions running in parallel after the update action.</p>
<p><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="79527638-9eef-4d90-8390-d9a662450cda" height="514" src="/sites/default/files/inline-images/2023-05-08%2018_11_13-Power%20Apps%20_%20Flows.png" width="913" /></p>
<p>Our objective is to tell the flow to execute the branch on the right (Log error branch) <strong>only in case</strong> an issue with the previous action, "Update Account owning team", occurs. To achieve this we use the feature "<strong>Configure run after</strong>" of the "Log error" action.</p>
<p>Using Configure run after you can tell the flow to run the specific action if and only if an error has occurred in the previous action. You can configure “Run After” to almost all Power Automate actions by simply clicking on the three dots on the right corner of the action which you wish to configure and select “Configure run after” from the drop-down menu.</p>
<p><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="e9e187ab-10e6-4892-940d-2d9d394e774e" height="614" src="/sites/default/files/inline-images/2023-05-08%2018_18_59-Power%20Apps%20_%20Flows.png" width="913" /></p>
<p>From there, you can select either one of the options or multiple options.</p>
<ul>
<li><strong>Is successful</strong> – If the action runs successfully.</li>
<li><strong>Has failed</strong> – An action has any type of failure (except timeout).</li>
<li><strong>Is skipped</strong> – An action was skipped. Actions are skipped either when a condition is not met, or when a previous action before that fails.</li>
<li><strong>Has timed out</strong> – An action times out. This can happen if the call to the backend times out (120 seconds), or for long-running actions such as approvals, after 30 days.</li>
</ul>
<p>We want to determine what the flow has to do when our update fails: we then select the "<strong>Has failed</strong>" option.</p>
<p><img alt="Select option in Configure run after" data-entity-type="file" data-entity-uuid="831b70cb-759a-44ba-ace4-67dba815ce87" src="/sites/default/files/inline-images/2023-05-08%2018_21_54-Power%20Apps%20_%20Flows.png" /></p>
<p>The error handling branch is displayed in the flow designer with a dotted line:</p>
<p><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="b24ffa4d-6d81-4a18-9cce-74e4909e3eaf" src="/sites/default/files/inline-images/2023-05-08%2018_27_30-Power%20Apps%20_%20Flows.png" /></p>
<p>At this point our flow will send the email when the assignment is successfully performed and it will execute the "Log error" action if the update fails.</p>
<p>Having handled the possible update errors in the Log error branch, this flow will result to have successfully run even if an error while updating the account occurred.</p>
<p>To avoid this and ensure that the failed flow is marked as "failed" in the run history, add a <strong>Terminate </strong>action at the end of the error handling branch as shown in the picture below.</p>
<p><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="58496447-99a1-4363-99e4-782b064a0b61" src="/sites/default/files/inline-images/2023-05-08%2019_07_39-Power%20Apps%20_%20Flows.png" /></p>
<p>What we are still missing now is how to get the error details to be logged into the Dataverse.</p>
<p>To get this information we can rely on built in functions. The function we need in this case is called <strong>actions</strong>: This function takes the action name as input parameter and it returns an action's output at runtime in JSON format. The JSON format has approximately the following structure (further fields could eventually be present):</p>
<pre>
<code class="language-json">{
"name": "Update_Account_owning_team",
"inputs": {
"parameters": {
"entityName": "accounts"
}
},
"outputs": {
"statusCode": 400,
"body": {
"error": {
"code": "0x80040203",
"message": "Attribute: ownerid cannot be set to NULL"
}
}
},
"startTime": "2023-05-10T12:08:27.6333954Z",
"endTime": "2023-05-10T12:08:49.3524607Z",
"code": "BadRequest",
"status": "Failed"
}</code></pre>
<p>From the JSON structure of the returned value I will extract the error message and I will put it into the "Error message" field of my custom entity "Error log" as shown in the picture below.</p>
<p><img alt="Actions function" data-entity-type="file" data-entity-uuid="fd0bcda1-c40a-4651-8405-0351aefb0aee" src="/sites/default/files/inline-images/2023-05-08%2021_42_19-Power%20Apps%20_%20Solutions%20-%20ErrorHandling.png" /></p>
<p>As the error message is nested in the JSON message, we need to use the following syntax to extract it :</p>
<p>actions('Update_Account_owning_team')?['outputs']?['body']?['error']?['message']</p>
<p>In our custom entity "Error log" we will now find all the errors occurred while updating the owning team of the accounts and the specific error message.</p>
<p><img alt="Error handling in Power Automate flows" data-entity-type="file" data-entity-uuid="d365a7f0-c4d5-4f33-90e4-9dbabb58037d" src="/sites/default/files/inline-images/2023-05-10%2015_15_56-Error%20Logs%20Active%20Error%20Logs%20-%20Dynamics%20365.png" /></p>
<h3>Handling errors in multiple actions</h3>
<p>So far we handled the errors that could happen in a single action. A flow usually consists of a lot of actions and handling the errors using "Configure run after" for each action in the flow is not an efficient approach. In order to be able to handle the errors occurring in multiple actions the best solution is to group the actions using the so called <strong>Scope </strong>blocks.</p>
<p>In the scope action I can nest all my flow actions (the initialisation of the variables cannot be nested into a Scope action and must be kept outside, before entering the scope) as shown below. I will call this scope block "<strong>Try</strong>" (according to the error handling patterns in other programming languages). </p>
<p>After the Try block I will then add another Scope action that I will call "<strong>Catch</strong>": on the Catch action I will then set the "Configure run after" exactly as I did for the single action before. The Catch block will then be executed <strong>only if one or more actions included in the Try block</strong> fail.</p>
<p><img alt="Try-Catch blocks" data-entity-type="file" data-entity-uuid="8e7828ab-4d80-4d38-a8cc-6009830ad0eb" src="/sites/default/files/inline-images/2023-05-10%2016_27_18-Power%20Apps%20_%20Solutions%20-%20ErrorHandling.png" /></p>
<p>In the Catch block we now need to get the details of what happened in the Try block: as in the Try block several actions could have thrown an error, we cannot use anymore the <strong>actions </strong>function as it refers to a specific action. Instead we will use the expression function called <strong>result. </strong>This function returns an array of objects consisting of the Input / Output information of the top-level actions in the specified scoped action. I now want to capture the Output of the actions in the Try block that have failed.</p>
<p>To do it I need to filter the array of objects returned by the "result" function to get the objects of the failed actions only. This can be achieved using the <strong>Filter array</strong> action. Finally we can use the action "Create HTML Table" to store the returned results in a structured way. We will rename this action "Select result".</p>
<p><img alt="Catch block" data-entity-type="file" data-entity-uuid="1d42cf83-b8a2-4989-8e62-f9c974aa530c" src="/sites/default/files/inline-images/2023-05-10%2017_27_12-Remote%20Desktop%20Web%20Client.png" /></p>
<p>The <strong>result </strong>expression is <strong>result('Try')</strong>, the <strong>status</strong> expression: <strong>item()?[status] </strong>while the <strong>Body </strong>is <strong>body('Filter_array_-_Status_=_Failed').</strong></p>
<p>Once you have all your information stored in the "Select result" action you are ready to use it and put it into the proper fields of the Error Log record.</p>
<p>To include information about the flow in your error log, such as the name of the flow, you also need to use the power automate function called <strong>workflow</strong>. This function returns the Id, the name, the type and some other information about the running flow. We will use it for getting the flow name and for retrieving the flow information needed for building the Url of the specific execution or run where the log was written (you can find the syntax of it below).</p>
<p>This is how our catch block looks like:</p>
<p><img alt="Final catch block" data-entity-type="file" data-entity-uuid="5b81723f-daa6-45fa-b2e0-6c2a4209067a" src="/sites/default/files/inline-images/2023-05-11%2011_39_08-Window.png" /></p>
<p>Here the expressions of the fields above:</p>
<p><strong>Action </strong>: outputs('Select_Result')?['body']?[0]?['Action'] </p>
<p><strong>Error message</strong>: outputs('Select_Result')?['body']?[0]?['Message']</p>
<p><strong>Execution Url</strong>: concat('https://flow.microsoft.com/manage/environments/', workflow()?['tags']['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']['name'])</p>
<h3>Using Flow templates </h3>
<p>When you create a new flow you get an empty page without any of the logic we just described. In order not to write the same error handling code every time you create a new flow you can prepare a flow including the <strong>Try-Catch</strong> pattern we just explained and use this flow as a template when you create a new one.</p>
<p>This is how the template flow would look like:</p>
<p><img alt="Flow template" data-entity-type="file" data-entity-uuid="d224305f-f048-4421-9feb-e16060ee594a" src="/sites/default/files/inline-images/2023-05-10%2017_23_58-Remote%20Desktop%20Web%20Client.png" /></p>
<p> </p>
<p>The <strong>Try</strong> block will contain the whole flow logic with its different actions.</p>
<p>The <strong>Catch error</strong> block can be the same for every flow and does not need to be changed when you start to develop a flow: this block will be like the one presented in the previous picture..</p>
<p>I also added a <strong>Catch success</strong> block where you can put the actions you want to take when the flow has successfully carried out its job, as sending an email or setting some flag or status to completed on other tables. You might want to track the executions of the flows in both cases, either it fails or it successfully runs: in this case you can log it in the same table with different status in the two catch blocks.</p>
<p>I mentioned before that using a custom entity to keep track of the flow failures is not an ideal solution because the Dataverse can quickly increase its size with a lot of error messages. An alternative solution would be using a Power BI Data Set or an external database for storing the error records, depending on your storage availability.</p>
<p>Well, we've come to the end of this article: I hope you enjoyed reading it and that it can be useful for your projects.</p>
<p>Meet you in the next Chronicle!</p>
<h2 class="title">Error handling in Power Automate flows</h2>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2023-05/Error%20handling%20in%20Power%20Automate%20flows.jpeg</div>
</div>
</div>
</div>
</div>
Tue, 30 May 2023 08:22:56 +0000Sergio Ferraresi644 at https://dynamics-chronicles.comCI/CD - TestingPower AutomateTutorialhttps://dynamics-chronicles.com/article/error-handling-power-automate-flows#commentsScale Power Automate Desktop (PAD) using multiple Machines
https://dynamics-chronicles.com/article/scale-power-automate-desktop-pad-using-multiple-machines
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Scale Power Automate Desktop (PAD) using multiple Machines</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/david-uhlmann" lang="" about="/user/david-uhlmann" typeof="schema:Person" property="schema:name" datatype="" class="username">David Uhlmann</a></span>
<span property="schema:dateCreated" content="2023-01-22T13:25:31+00:00" class="field field--name-created field--type-created field--label-hidden">Sun, 01/22/2023 - 14:25</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>Scale Power Automate Desktop (PAD) using multiple Machines</em></p>
<p>Whether you should use Power Automate Desktop or not has been described by my colleague in the community Reza Dorrani in his excellent video about this topic (<a href="https://www.youtube.com/watch?v=z19CAWq1tK8">https://www.youtube.com/watch?v=z19CAWq1tK8</a>).<br />
However, since the practical application of this topic is relatively rare we cannot cover all uses cases. So we will show how to scale a small solution to multiple machines. One thing in advance: The solution shown here should only be used as a last "resort" if you can't or don't want to replace the corresponding solution with a newer application that has an API (e.g. due to budget restrictions).</p>
<p><strong>Power Automate Desktop (PAD)</strong>, at least in the context of Power Automate cloud flows, is a <strong>bridging technology</strong> for applications without API. It does this very well, without question. However, it should by no means be seen as a long-term solution. A clearly better solution is to scrap the old software and replace it with a modern solution, for example based on the Power Platform. But anyways, lets go now. Keep in mind the following scenario is very much simplified to keep this article within reading span of most people.</p>
<p>In the following scenario we have a VM with Power Automate Desktop and a corresponding flow. Next to it we have a second VM on which nothing else is currently happening:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="2735cdca-38cd-4e24-bc14-e6e7c577d529" height="463" src="/sites/default/files/inline-images/VMs%20before%20expansion.png" width="1446" class="align-center" />
<p>In our use case, to keep the example simple, we have an Excel file that stores contact information. Two flows exist for this purpose: <strong>1x a Power Automate Desktop flow </strong>that fetches the data from the Excel file and <strong>1x a cloudflow</strong> that checks if there is a duplicate when creating a contact. So far so good:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="7e097f34-5b6b-4c3e-99a0-ce99ddec0322" height="767" src="/sites/default/files/inline-images/process%20sample.png" width="1430" class="align-center" />
<p>When the users enters a name which is in the Excelfile s/he gets flag telling her/him that this user might be a duplicate. However, this solution is not so good for two main reasons:</p>
<ul>
<li>If the mentioned VM has unplanned downtime, the described mechanism is not available and the cloudflow would time out.</li>
<li>This approach also has disadvantages with a high workload, i.e. many users creating contacts. There may be long waiting times.</li>
</ul>
<p>To prevent such problems, Microsoft offers the possibility to combine several VMs in a machine group. How this works is shown in the following steps. What we need to do is:</p>
<ol>
<li><strong>Start a new VM (this we have already done)</strong></li>
<li><strong>Install PAD, launch the portal and add the new VM to the machine group</strong></li>
<li><strong>Update cloud flow connection if needed</strong></li>
</ol>
<p>To go one, first thing is create a new machine group:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="2ff617d6-eedb-460b-89bb-27f4d22313a5" height="806" src="/sites/default/files/inline-images/create%20a%20new%20machine%20group.png" width="1449" class="align-center" />
<p>Once you have created a machine group, or you already had one, you can go to <strong>step 2 (installing PAD and launching the portal)</strong>. How to get PAD is described by an in detail MS Learn article: <a href="https://learn.microsoft.com/en-us/power-automate/desktop-flows/install">https://learn.microsoft.com/en-us/power-automate/desktop-flows/install</a> . After installation is done you can log in with your account to the Power Automate Desktop Portal on the second VM. Here you should see something like this:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="b2d8e0b8-88cc-42c3-a3b5-e2e75b368d12" height="841" src="/sites/default/files/inline-images/adding%20second%20VM%20to%20machine%20group.png" width="1434" class="align-center" />
<p>At this point the <strong>password of the Machine Group</strong> has to be entered, i.e. <strong>not the password of the admin account</strong> of the Power Platform or the local admin. The password of the Machine Group can be set as often as you like. So last we need to change the connection of the Cloud Flow to the connection of the Machine Group. This is done so that the Cloud Flow can also use the full power of the, now two, machines. For starters I would advise you to go to <a href="make.powerautomate.com ">make.powerautomate.com </a>which is the cloud portal for all power automate related activities. There you have more options than in the classical power platform portal:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="19b31123-72dc-42d8-9011-a23eb34d58fb" height="774" src="/sites/default/files/inline-images/power%20automate%20portal_0.png" width="1444" class="align-center" />
<p>So now you need to open your cloud flow and update the connection to the machine group instead of the single machine. You click on the three dots of the action and select "<em>New connection reference</em>", then you should see something like this:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="4f3debcd-68f6-441f-bc37-2427d3a55760" height="778" src="/sites/default/files/inline-images/before%20new%20connection.png" width="1441" class="align-center" />
<p>It is recommended to login at every machine inside your machine group with the same user. Most solutions that are displayed in the internet recommend this. This makes it easier giving the connection one username and one password. For simplicity I just use my personal user, but in practice you would create an AAD Admin user that has admin rights on all the machines.</p>
<p>Once you are done, you should see something like this:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="bdef6620-1ebc-4a23-bfc7-667c736d6924" height="782" src="/sites/default/files/inline-images/after%20new%20connection.png" width="1455" class="align-center" />
<p>Once all this is done you should make sure to log in to all the machines you want to us, or if you run your flows in unattended mode you have to log out. Now its time to test the machine group. To do that I will create multiple contacts shortly after another, knowing that the flow will take a while to start PAD, read the excel file, give results back and loop over it to check the results:</p>
<img alt="flow runs after machine group was installed" data-entity-type="file" data-entity-uuid="2d1d382f-46af-4262-8c16-e7ed17d6a22c" height="736" src="/sites/default/files/inline-images/flow%20runs%20test.png" width="1437" class="align-center" />
<p>Now there is only one thing left to do. <strong>We want to check if the flows are really executed on different VMs.</strong> To check this we first need the "hostnames" of the two machines. This can be displayed on every Windows with the command "hostname". In my case the first hostname ends with: (...) <strong>VMPA</strong> and the second one ends on (...) <strong>U0Q4</strong>. <br />
Now we have to check where the flow run was executed. For this we open a flow run and click on the details of the connector:</p>
<img alt="how to get to flow runs details of group" data-entity-type="file" data-entity-uuid="b63e2228-cb71-4984-a5a7-3f10c3be3740" height="825" src="/sites/default/files/inline-images/flow%20details.png" width="1426" class="align-center" />
<p>After this you should see a screen like the following:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="cb7d3cad-a6eb-46bc-b905-811724f60a1a" height="955" src="/sites/default/files/inline-images/machine1%20run.png" width="1445" class="align-center" />
<p>So lets check out another run now:</p>
<img alt="Scale Power Automate Desktop (PAD) using multiple Machines" data-entity-type="file" data-entity-uuid="2c8a7dbc-05a8-451a-8c93-f30f4a747590" height="945" src="/sites/default/files/inline-images/machine2%20run.png" width="1437" class="align-center" />
<p><strong>If you made it that far & could reproduce: congratulations</strong>! Now you are ready to scale as many VMs as you want using Power Automate Desktop using machine groups. This piece was only a glimpse of things you can/should do. Stuff like automatic checks if your machines are running, and respective actions if not, would have been too much for such a piece. If you are interested in such content comment below and we might publish it in the future (using Power Automate of course :-)</p>
<h2 class="title">Scale Power Automate Desktop (PAD) using multiple Machines</h2>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2023-01/turn-on-gf61b49ce2_1920.jpg</div>
</div>
</div>
</div>
</div>
Sun, 22 Jan 2023 13:25:31 +0000David Uhlmann614 at https://dynamics-chronicles.comHow to get dynamic Record URL in Power Automate (quick tip)
https://dynamics-chronicles.com/article/how-get-dynamic-record-url-power-automate-quick-tip
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">How to get dynamic Record URL in Power Automate (quick tip)</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/david-uhlmann" lang="" about="/user/david-uhlmann" typeof="schema:Person" property="schema:name" datatype="" class="username">David Uhlmann</a></span>
<span property="schema:dateCreated" content="2022-07-10T11:03:47+00:00" class="field field--name-created field--type-created field--label-hidden">Sun, 07/10/2022 - 13:03</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>How to get dynamic Record URL in Power Automate</em></p>
<p>There seems to be some amount of confusion on the web about how to use <strong>Power Automate </strong>to get the <strong>dynamic record URL of a record in Dynamics CE.</strong></p>
<p>Power Automate comes with a few onboard tools. To understand what we are talking about here. A typical Dynamics CE URL, here for an opportunity record, might look like this:</p>
<p><img alt="How to get dynamic Record URL in Power Automate" data-entity-type="file" data-entity-uuid="c2356fcc-f344-4a39-89fb-b2fd9c123201" src="/sites/default/files/inline-images/Screenshot1a_0.png" /></p>
<p>If you want to create this URL inside a Power Automate flow, for example, to put it inside an approval e-mail you need to think about how to do it.</p>
<p>For example, you can parse the JSON output of an action to get the URL of the Dynamics instance:</p>
<p><img alt="How to get dynamic Record URL in Power Automate" data-entity-type="file" data-entity-uuid="9f3eb733-ac79-44b0-927c-248875f46387" src="/sites/default/files/inline-images/Screenshot1_1.png" /></p>
<p>The <em>body</em> part contains many technical details that are exchanged inside the flow while it is running. Among them is also a URL. This output can later be used with an expression like <em>uriHost(body('GetOpportunity')?['@odata.id'])</em> can be parsed. From this you will get the following URL:</p>
<p><em>https://org18eb47a1.crm4.dynamics.com/</em>. However, what is still missing is the App ID and the GUID of the record to assemble the link. </p>
<p>If you search the net on how to assemble this link dynamically you will find a few sources that follow two approaches. The first approach tries to determine all important components (Dynmics URL, App-ID, and GUID) with flow board means, while the second approach relies fully on JavaScript. However, both approaches have a fundamental disadvantage. They (often) assume that the components of the link that are between those "core" elements do not change. Likewise, these solutions are valid but still somewhat of a "tinker". </p>
<p>So our goal is something like this:</p>
<p><img alt="How to get dynamic Record URL in Power Automate" data-entity-type="file" data-entity-uuid="1e737bcf-77ce-4a4d-b8b7-2981e610bdb9" src="/sites/default/files/inline-images/Screenshot3_0.png" /></p>
<p>Well, there is a simple trick to get to this link. This one uses good old Dynamics CE onboard tools. What to do here, at least that would be my suggestion, is:</p>
<p>1.) Create a new field (I called it "<strong><em>RecordURL</em></strong>").</p>
<p>2.) Set up a "<em>Real-Time</em>" workflow on the corresponding entity (Important <strong>NOT</strong> run workflow in the background - It has to be the real-time one!)</p>
<p>3) Whenever changes are made to the record (for example, when saving), the dynamic URL is written into this field.</p>
<p>4) Using this field in Power Automate</p>
<p><img alt="How to get dynamic Record URL in Power Automate" data-entity-type="file" data-entity-uuid="fee9e94a-15e9-4e3b-908d-d005f8edb6d0" height="506" src="/sites/default/files/inline-images/Screenshot4_0.png" width="1105" /></p>
<p>We can now use this field in our Approval Flow. Whenever an approval email is being sent, the person will receive a direct link to the record:</p>
<p><img alt="How to get dynamic Record URL in Power Automate" data-entity-type="file" data-entity-uuid="0170628f-ade9-4064-9522-cbb080b5cc6b" src="/sites/default/files/inline-images/Screenshot5_0.png" /></p>
<p>This screenshot also shows that these days you can forget about hyperlink formatting, as this is done by the tool for you. So let's check if this one works out:</p>
<p><img alt="How to get dynamic Record URL in Power Automate" data-entity-type="file" data-entity-uuid="73350a6e-6e0e-4631-ab4a-769c0becc703" src="/sites/default/files/inline-images/Screenshot6_2.png" /></p>
<p>Because Sales is probably the most obvious case for approval processes, I have created a simple approval process as an example here.</p>
<p>This checks if the amount is above 3 million USD and if the approval status is not "Yes". After the user hits save the flow is triggered and contains the URL to the record:</p>
<p><img alt="appr email" data-entity-type="file" data-entity-uuid="960d48fa-9c73-4401-97e1-a8732952cf74" src="/sites/default/files/inline-images/Screenshot7_1.png" /></p>
<p>When I click on the link I get directly to the record. And this is more or less it. If you have trouble building this do not hesitate to reach out to me. p.s: sometimes it is a good idea to check the "good old" onboard things :-)</p>
<h2 class="title">How to get dynamic Record URL in Power Automate</h2>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2022-07/trick2.png</div>
</div>
</div>
</div>
</div>
Sun, 10 Jul 2022 11:03:47 +0000David Uhlmann576 at https://dynamics-chronicles.comPower Automatehttps://dynamics-chronicles.com/article/how-get-dynamic-record-url-power-automate-quick-tip#commentsDynamics 365 InApp Notification
https://dynamics-chronicles.com/article/dynamics-365-inapp-notification
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Dynamics 365 InApp Notification</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/maxime-bonnot" lang="" about="/user/maxime-bonnot" typeof="schema:Person" property="schema:name" datatype="" class="username">Maxime Bonnot</a></span>
<span property="schema:dateCreated" content="2022-07-05T12:45:14+00:00" class="field field--name-created field--type-created field--label-hidden">Tue, 07/05/2022 - 14:45</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>Dynamics 365 InApp Notification</em></p>
<p>An interesting feature has been released in 2022 Wave 1 : <strong>In App Notification</strong></p>
<p>According to Microsoft documentation, this feature would ease the communication and the collaboration within Dynamics 365.</p>
<p>I think that we are all familiar with the concept of Notification as we all have a Smartphone and this concept isn't really different when it comes to Dynamics CRM.</p>
<p>Therefore, let's not loose time and let's try this new feature.</p>
<p>First let's see how to enable this feature. I will also add some technical information that might useful if you want to try it right away. Finally, we will see how to use it and to which point this might be interesting for business purposes.</p>
<h2>I - In App Notification</h2>
<p>In order to enable In App Notification : Go to make.powerapps.com > Apps > Click on the 3 dots in your app row > Edit > In the App Editor, click on Settings > Feature tab > Enable In-app notifications as below :</p>
<img alt="Dynamics 365 InApp Notification" data-entity-type="file" data-entity-uuid="fb75d076-8153-49ac-a28a-042dd3fc0a1e" src="/sites/default/files/inline-images/enableinappnotif_0.png" class="align-center" />
<p>Then Save and Publish : you will be able after refreshing, to see a new notification icon in the upper bar : <img alt="Dynamics 365 InApp Notification" data-entity-type="file" data-entity-uuid="318e8184-aef9-4e30-b8f6-cfb7c0178e35" height="34" src="/sites/default/files/inline-images/notificon_0.png" width="41" /></p>
<p>If you click on it, a side pane will be displayed on the right sight with the possibility to access notification settings allowing the user to decide whether or not Toasts are enabled and for which duration.</p>
<p>Also notice that a new Notification table is appearing in the Dataverse. This Notification table has the following fields :<br />
<strong>Title</strong> : Title of the notification<br />
<strong>Owner</strong> : The user who receives the notification<br />
<strong>Body</strong> : Details about the notification<br />
<strong>IconType</strong> : Predefined Icon depending if it is a success, error or information message<br />
<strong>Toast type</strong> : The list of notification behaviors<br />
<strong>Expiry</strong> : The number of seconds from when the notification should be deleted if not already dismissed<br />
<strong>Data</strong> : JSON that's used for extensibility and parsing richer data into the notification. The maximum length is 5,000 characters.</p>
<p>Apparently this feature will allow us to create any kind of notification for any kind of action within the Dynamics 365. No doubt that In App Notification might be really useful for business. Though let's make sure of it !</p>
<h2>II - In practice</h2>
<p>As it makes me think on one of my client, I will make this demonstration according to its need.</p>
<p>We talk here about a watch manufacturer having Boutique all over the world. In those boutique, beside selling watch, we also submit customer service request. Those customer service request have to be treated in a limited time. So the Boutique creates and assigned a customer service request to the concerned person. Although this person suppose to take care of the request doesn't always notice it unless he checks his Request view constantly in order to don't miss anything. In reality, as you can imagine, it make them loose a precious time and in the worse case scenario, a request can be missed which is terrible for the image of the company.</p>
<p>According to this, I will create a flow triggering on Opportunity whenever the owner is modified and so create a notification to the owner it is assigned to.</p>
<p>Here it is :</p>
<img alt="Dynamics 365 InApp Notification" data-entity-type="file" data-entity-uuid="2cc7f2a9-73b2-4008-8a0f-b45735e496a1" height="740" src="/sites/default/files/inline-images/flownotification_0.png" width="467" class="align-center" />
<p>After turning on this flow, I will merely assigned an opportunity to myself as below :</p>
<img alt="Dynamics 365 InApp Notification" data-entity-type="file" data-entity-uuid="d9e0a26a-a36f-4be2-a0ac-e4748e452e38" height="299" src="/sites/default/files/inline-images/assign_0.png" width="911" class="align-center" />
<p>As soon as the page is refreshed, a notification is displayed on the right sight informing the owner that he got a new Opportunity assigned to him :</p>
<img alt="Dynamics 365 InApp Notification" data-entity-type="file" data-entity-uuid="88f4edc5-8aac-469a-bdc6-3e1c0f69f50b" height="169" src="/sites/default/files/inline-images/notificationassignemnt.png" width="394" class="align-center" />
<p>You can then check the side pane by clicking on the notification icon itself :</p>
<img alt="Dynamics 365 InApp Notification" data-entity-type="file" data-entity-uuid="d3ed6678-eee1-464f-be39-054cddd9243f" src="/sites/default/files/inline-images/notif2.png" class="align-center" />
<p> </p>
<p>As you can see, we created on a really easy and quick way a logic that might fit with Business requirements.</p>
<h2>Conclusion</h2>
<p>As I mentioned in part II, In App Notification is a feature that will surely fit business expectations. For those who need to push employees to pay attention to a task.</p>
<p>We now don't have to over load employees mailbox in order to make sure that they notice a new task for instance.</p>
<p>With In App Notification, notification can be created really quickly and for any kind of changes ! </p>
<p>It was definitely something missing in my opinion so I will not hide that I am glad to be able to propose this to our clients from now on.</p>
<h2 class="title">Dynamics 365 InApp Notification</h2>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2022-07/notif.png</div>
</div>
</div>
</div>
</div>
Tue, 05 Jul 2022 12:45:14 +0000Maxime Bonnot543 at https://dynamics-chronicles.comAzure Logic Apps : Presentation, Tips and Feedbacks
https://dynamics-chronicles.com/article/azure-logic-apps-presentation-tips-and-feedbacks
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Azure Logic Apps : Presentation, Tips and Feedbacks</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/stephane-pelhatre" lang="" about="/user/stephane-pelhatre" typeof="schema:Person" property="schema:name" datatype="" class="username">Stephane Pelhatre</a></span>
<span property="schema:dateCreated" content="2022-04-25T12:07:32+00:00" class="field field--name-created field--type-created field--label-hidden">Mon, 04/25/2022 - 14:07</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>Azure Logic Apps : Presentation, Tips and Feedbacks</em></p>
<h2>Introduction</h2>
<h3>Presentation</h3>
<p>Logic Apps is a cloud-based platform (Azure) for creating and running automated workflows that integrate with applications, data, services and systems. With Logic Apps we can create complex workflows/orchestrations. An orchestration is a collection of actions that are executed to accomplish a specific task.</p>
<p>A workflow always starts with a single trigger, which specifies the condition to meet before running any action in the workflow. Each time the trigger fires, Azure Logic Apps creates and runs a workflow instance.<br />
A trigger is usually an event or a HTTP request.</p>
<p>Below is an overview of the web-based interface of Logic Apps:</p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="bb630f0c-1daa-40c4-a23c-aac2c54f2a9d" src="/sites/default/files/inline-images/GUI_0.png" /></p>
<p> </p>
<h3>Dynamics 365 And Logic Apps</h3>
<p>Current situation with Dynamics 365 is a little bit weird in Logic Apps.<br />
Main connectors to interface with D365 (for instance with Power Automate) are <em>Dynamics 365</em> and <em>Common Data Service.</em><br />
But if you type 'Dynamics 365' in Logic Apps to get the list of available connectors related to D365, you will see that:</p>
<ul>
<li>You get a deprecated version of <em>Dynamics 365</em> connector<br />
<img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="f4745c66-7fd4-4f44-a32c-5c90cd15a35d" src="/sites/default/files/inline-images/deprecated_0.png" /></li>
<li>The <em>Common Data Service</em> connector is not listed</li>
</ul>
<p>In fact <em>Dynamics 365</em> connector used for Logic Apps is officially deprecated by Microsoft. And <em>Common Data Service</em> connector was renamed to <em>Microsoft Dataverse</em> <em>(legacy)</em>.<br />
So Microsoft recommendation for Logic Apps is to use the <em>Microsoft Dataverse (legacy)</em> connector.<br />
Note the term <em>'Legacy' </em>in the name of the connector.<br />
The <em>Microsoft Dataverse (legacy)</em> connector will eventually be deprecated in the feature and new Microsoft Dataverse connector will be used instead. Currently this new connector is not supported on Logic App and Microsoft team is working on provisioning that support. So wait and see...<br />
<br />
A connector for <em>Dynamics 365 for Finance and Operations</em> (F&O) is available</p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="8a2a9fef-4b2b-4edb-9a1c-6ee294ccd1ed" src="/sites/default/files/inline-images/F%26O.png" /></p>
<p>It contains an event trigger:</p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="529d79f6-f778-4d71-ba93-2703dbf7a5fa" src="/sites/default/files/inline-images/event.png" /></p>
<p>And a set of actions :</p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="815dfa2d-1b2b-4c5f-9eaa-43822ae5f198" src="/sites/default/files/inline-images/actions.png" /></p>
<p> </p>
<h2>Logic Apps workflows management</h2>
<h3>Available tools to design Logic Apps workflows</h3>
<p>You can design a workflow in Logic Apps with several tools:</p>
<ul>
<li>Web-based designer in the Azure portal</li>
<li>Microsoft Visual Studio Code</li>
<li>Microsoft Visual Studio</li>
</ul>
<p>A Workflow has an underlying definition that's described using JavaScript Object Notation (JSON).<br />
When you design your workflow it is possible to access at anytime the JSON source code whatever tool you use.<br />
Note that sometimes it is faster to modify JSON code to implement some changes (setting variables, calculations, ...).</p>
<p>Below is an overview of a Logic Apps workflow in Visual studio code : available triggers/actions on the left, graphical designer in the middle, JSON code on the right.</p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="515aec8f-d1f7-4393-91e7-02c6bf8b403e" src="/sites/default/files/inline-images/example-visual-studio-code_2.png" /></p>
<p> </p>
<h3>Create a Logic Apps workflow in Azure Portal</h3>
<p>I describe below the method to create a workflow with the web-based designer.<br />
To create a Logic Apps workflow connect to Azure Portal, go to Azure services and click on<em> Logic Apps</em> icon</p>
<p><img alt="logic app portal" data-entity-type="file" data-entity-uuid="81154efe-96c6-4b1b-8ef5-a8c3f3642bc0" src="/sites/default/files/inline-images/logic%20app%20portal_0.png" /></p>
<p>You will have to select your Azure subscription, a resource group and a region and give a name to your Logic Apps<br />
When your Logic App is successfully created then you have to create a workflow: select <em>Workflows </em>in the sidebar on the left, click on the <em>Add </em>button and set a name for your new workflow.<br />
Note that a Logic Apps can contain several workflows.</p>
<p><img alt="sidebar" data-entity-type="file" data-entity-uuid="37737a81-a89a-43b0-ae47-0c95c99a2b14" src="/sites/default/files/inline-images/sidebar.png" /></p>
<p>Then you are ready to perform the first task: adding a trigger.<br />
In the below example I select Azure connector <em>'Fin & Ops Apps (dynamics 365)'</em> and select '<em>When a Business Event Occurs</em>'</p>
<p><img alt="designer1" data-entity-type="file" data-entity-uuid="384e11f2-6c9a-4da1-a0a9-1c90bcebdb1a" src="/sites/default/files/inline-images/designer1_1.png" /></p>
<p> </p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="f7746dde-802c-40d3-8143-2ebd9d6c632f" src="/sites/default/files/inline-images/trigger.png" /></p>
<p>When your event is configured you can then add actions: below I added an action to parse the result of the business event and then I initialize a variable</p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="126224ff-37b0-41a8-a1b5-cbe38c24da8f" src="/sites/default/files/inline-images/designer2_0.png" /></p>
<p> </p>
<p>There is a wild range of actions available in Logic Apps separated in two categories: built-in actions and Azure actions.</p>
<ul>
<li><strong>built-in actions</strong> : control workflow (condition, For Each loop, switch, ...), manage or manipulate data (data operations, variables management, operations with timestamps, ...).<br />
Below buit-in actions groups:</li>
</ul>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="591c25a2-7fea-442d-ac26-abf17cc28742" src="/sites/default/files/inline-images/builtin.png" /></p>
<p>And for action group 'Variables' the list of available actions:</p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="86f714a7-12b2-47bb-b5aa-144d6b027471" src="/sites/default/files/inline-images/variables_0.png" /></p>
<ul>
<li><strong>Azure actions</strong>. More than 200 connectors are available (from Microsoft and third party providers). Below is a list of widely used connectors:
<ul>
<li>HTTP</li>
<li>Azure Blob Storage</li>
<li>Azure Functions</li>
<li>SQL Server</li>
<li>SharePoint Online</li>
<li>Service Bus</li>
<li>Salesforce</li>
<li>FTP</li>
<li>Gmail</li>
<li>YouTube</li>
</ul>
</li>
</ul>
<p>Some values can be set by <strong>built-in functions</strong>. Many functions (called expressions) are available:</p>
<p>• String functions : concat, split, startswith, substring, trim, length, ...<br />
• Collection functions : contains, first, last, intersection, ...<br />
• Logical comparison functions : and/or, equals, greater, less, ...<br />
• Conversion functions: bool, float, int, ...<br />
• Math functions : add, div, mul, min, max, ...<br />
• Date and time functions : addDays, dayOfMonth, formatDateTime, ...<br />
• Workflow functions<br />
• URI parsing functions<br />
• Manipulation functions: JSON & XML</p>
<p>An expression Editor is available to navigate through all functions.<br />
Below I use the <em>int()</em> function to cast a string value (quantity) to an integer.</p>
<p><img alt="int" data-entity-type="file" data-entity-uuid="66f4d3a0-3cfb-4b39-bbfb-4658ecf868db" src="/sites/default/files/inline-images/int.png" /></p>
<p>But if you know the name of the function you need it is usually easier to edit the JSON code.</p>
<p><strong>Logic Apps and loop control</strong></p>
<p>You have to be careful with loop control component (For Each).<br />
<img alt="foreach" data-entity-type="file" data-entity-uuid="141d04d4-fff6-4491-b015-2a0567da613b" src="/sites/default/files/inline-images/foreach.png" /><br />
By default, iterations in a loop run at the same time, or in parallel. This behavior differs from Power Automate's '<em>Apply to each loop</em>' where iterations run one at a time, or sequentially.<br />
Default value for degree of parallelism is 20.<br />
It is possible to modify this value In the settings of the component and to set up sequential "For each" loop iterations.</p>
<p><img alt="Azure Logic Apps : Presentation, Tips and Feedbacks" data-entity-type="file" data-entity-uuid="c0781d39-0257-44c7-ae8e-6ef27d4f9b15" src="/sites/default/files/inline-images/designer3_0.png" /></p>
<p>Note that if the default behavior (loops running in parallel) is normally reliable for simple loops. But with nested loops you can get unpredictable results.<br />
Always set degree of parallelism to 1 when you manipulate nested loops.<br />
To get predictable results from operations on variables during each loop iteration, run those loops sequentially. For example, when a concurrently running loop ends, the increment, decrement, and append to variable operations return predictable results. However, during each iteration in the concurrently running loop, these operations might return unpredictable results.<br />
According to Microsoft documentation iterations always run sequentially, not in parallel with nested loops. But based on my own experience it is not the case so always check that degree of parallelism is equal to 1 for nested loops.</p>
<p>Another situation where you need to set the loop to run sequentially is when you want to pause the next iteration in a "For each" loop by using the Delay action</p>
<h2>Logic Apps and Power Automate</h2>
<p>Logic Apps and Power Automate are both designer-first integration services that can create workflows. Both services integrate with various applications using connectors.<br />
Power Automate is built on top of Logic Apps. They share the same workflow designer.</p>
<p>Key differences between Logic Apps and Power Automate:</p>
<ul>
<li>Logic Apps is part of the Azure platform. It requires an Azure subscription in order to build and run logic apps.<br />
Power Automate is available as part of O365/Dynamics 365 applications</li>
<li>Logic App is PaaS and Power Automate is SaaS</li>
<li>There is the concept of standard and Premium connectors in Power Automate but not in Logic Apps.<br />
Premium connectors require additional licenses.</li>
<li>With Logic Apps you can manage the Office 365 platform and Azure platform. Logic Apps has a lot of actions to create, configure, connect and delete many kinds of Azure resources. They can connect to function apps, delete blob storage, create a virtual machine and so on.<br />
Power Automate also has a lot of actions to manage Azure, but many of them require a premium connector. As discussed earlier, premium connectors are costly.</li>
<li>You can work with Logic Apps in a browser (web-based designer) or with a development tool as Visual Studio or Visual Studio Code<br />
Power Automate is a browser-based application so you can modify a workflow only in a browser</li>
<li>Logic Apps and Power Automate generate JSON for created apps and workflows.<br />
In Power Automate we can see the generated JSON but unfortunately we cannot edit the JSON.<br />
In Logic Apps, we can see the generated JSON. But unlike Power Automate, we can edit the generated code. The edited JSON will be automatically converted into actions in the workflow. This feature allows us to copy content from one action to another, and we can even copy actions from one workflow to another.</li>
<li>Logic Apps cannot be operated upon from mobile application<br />
Power Automate can be accessed or modified in a mobile app</li>
<li>For Logic Apps you pay as you use (whenever something runs: logic Apps, connectors, triggers, actions, ...). It is a consumption-based billing service, which requires an Azure Subscription in order to build and run logic apps<br />
For Power Automate you pay per flow or per user basis (license assigned to a user)</li>
<li>With Logic Apps you can create workflows with complicated requirements.<br />
With Power Automate you create simple workflows.<br />
Power Automate is used by business people to concentrate on their workflow. On the other hand, Logic Apps is used by people to run their apps and other services.</li>
<li>Since Logic Apps is an Azure service, developers are able to take advantage of Azure Monitoring, which will raise alerts when there are failures that occur within Logic Apps or other Azure services. </li>
</ul>
<p> </p>
<p>Decision points between Logic Apps and Power Automate:</p>
<ul>
<li>If your workflow is mostly using Azure services then you should use Logic Apps. If you workflow is using Office 365/Dynamics 365 then you should use Power Automate.</li>
<li>If your workflow is designed by a software developer you should use Logic Apps. Integration with Visual Studio is an advantage.<br />
For non-developer audience you can use Power Automate.</li>
<li>You should also check if the connector you need is provided in both environments. Even if Microsoft claims that connectors are available in both Azure Logic Apps and Power Automate, reality is slightly different.</li>
</ul>
<h2>What about Azure Function ?</h2>
<p>The audience of Azure Function is different: to write an Azure function you have to use a language as C# or JavaScript. So it is more technical.<br />
But in a Logic Apps workflow it is possible to call an Azure function. For instance if you have a complex calculation with many operators you will write an Azure Function to perform this complex task and then you will call the Azure Function in your Logic Apps workflow to get the result.<br />
And if in your calculation you have to implement loops and check conditions (IF... ELSE) it is definitively a good idea to use Azure Function.<br />
As explained previously all those tasks are possible with Logic Apps but you will save time if you embed all this logic in an Azure Function.<br />
If you have a complex logic a Logic Apps workflow diagram can be difficult to read in the designer. And maintainability of the Logic App can be a problem.<br />
Perhaps Microsoft should have chosen another name than "Logic Apps"...<br />
Another advantage of Azure Function is execution speed: calculations and complex logic (conditions, loops) run faster in an Azure Function than inside a Logic App workflow.<br />
</p>
<h2>Conclusion</h2>
<p>Logic Apps can be a great tool if you have to interface an application with another third party application if a Logic App connector exists for that third party app.<br />
For example a scenario could be to add a button in your application to connect to another application in order to get data you finally display in your application.You simply have to generate a Business event and write a logic Apps workflow with a couple of components: a Business event trigger, a connector to the third party application, some basic logic and it's done...<br />
Logic Apps is perfect for that scenario.<br />
But if your have a complex logic you will probably have to additionally use Azure Functions to get better performance.</p>
<p>Concerning the choice between Logic Apps and Power Automate:<br />
If you have to interface with Office365 / Dynamics 365 the choice is easy : use Power Automate.<br />
Otherwise Logic Apps is probably a better choice : main argument is that what you can do with Power Automate can be done with Logic Apps. But the opposite is not always true.<br />
If you have an Azure subscription and are familiar with Azure services Logic Apps is also probably a better choice.<br />
Another advantage of Logic Apps: the possibility of modifying the generated JSON code. If you are a software developer you will save time and will be more productive.</p>
<h2 class="title">Azure Logic Apps : Presentation, Tips and Feedbacks</h2>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2022-06/Azure%20Logic%20Apps%20presentation%20and%20focus%20on%20D365%20FO%20Dataverse_2.png</div>
</div>
</div>
</div>
</div>
Mon, 25 Apr 2022 12:07:32 +0000Stephane Pelhatre548 at https://dynamics-chronicles.comAzurePower AutomateToolsTutorialhttps://dynamics-chronicles.com/article/azure-logic-apps-presentation-tips-and-feedbacks#commentsPower Automate: Auto expand flows and auto reconnect flows after import
https://dynamics-chronicles.com/article/power-automate-auto-expand-flows-and-auto-reconnect-flows-after-import
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Power Automate: Auto expand flows and auto reconnect flows after import</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/nguyen-thanh-khoi" lang="" about="/user/nguyen-thanh-khoi" typeof="schema:Person" property="schema:name" datatype="" class="username">Nguyen Thanh Khoi</a></span>
<span property="schema:dateCreated" content="2021-10-27T08:40:20+00:00" class="field field--name-created field--type-created field--label-hidden">Wed, 10/27/2021 - 10:40</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>Power Automate: Auto expand flows and auto reconnect</em></p>
<p>In this article, I would like to share 2 tips when working with PowerAutomate: expand all components in a Flows and auto re-connect flows after import.</p>
<h2><span style="color:#2980b9;">1. How to exapand all components in a Flow</span></h2>
<p>When I work with a big flow which contains a huge number of actions inside and I must click on each actions, one by one. It will take a lot of time to do it. So with the following way, you could do it with only a click. The idea is: we will use a script to inspect the DOM of HTML page so it could not run if oneday, MS has change the name of class of element.</p>
<ul>
<li>Open Bookmark Manager then add a bookmark to Chrome or Firefox with the following code:</li>
</ul>
<pre>
<code class="language-javascript">javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3Bvar%20expand%20%3D%20function()%7B%24('.msla-card-title-group%5Baria-expanded%3D%22false%22%5D').click()%3Bif(%24('.msla-card-title-group%5Baria-expanded%3D%22false%22%5D').length%3E0)%7BsetTimeout(expand%2C1000)%3B%7D%7D%3Bexpand()%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.11.1%2Fjquery.min.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()</code></pre>
<ul>
<li>Open a flow:</li>
</ul>
<img alt="Power Automate: Auto expand flows and auto reconnect" data-entity-type="file" data-entity-uuid="7314101f-afd4-41fc-9341-ab5a15841dfb" height="389" src="/sites/default/files/inline-images/Image%201_5.png" width="942" class="align-center" />
<ul>
<li>Click Expand Flow: Click the recent bookmark "Expand Flow" then all actions of your Flows are expanded.</li>
</ul>
<img alt="Power Automate: Auto expand flows and auto reconnect" data-entity-type="file" data-entity-uuid="b322294f-bb5d-407a-9bd7-0d761aebc79d" height="467" src="/sites/default/files/inline-images/Image%202_3.png" width="915" class="align-center" />
<p> </p>
<p>You could set up a Collapse bookmark with the same way to collapse all components:</p>
<ul>
<li>Add a Bookmark with the following code:</li>
</ul>
<pre>
<code class="language-javascript">javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3Bvar%20collapse%20%3D%20function()%7B%24('.msla-card-title-group%5Baria-expanded%3D%22true%22%5D').click()%3Bif(%24('.msla-card-title-group%5Baria-expanded%3D%22true%22%5D').length%3E0)%7BsetTimeout(collapse%2C1000)%3B%7D%7D%3Bcollapse()%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.11.1%2Fjquery.min.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()</code></pre>
<p> </p>
<h2><span style="color:#2980b9;">2. How to re-connect flows after import</span></h2>
<p>When I deploy the flow between multiple environments, One of the biggest issues I faced with Flows is I must re-connect all of the connections everytime. This take a lot of time to do it for every time I deploy especially I work with big flows. So the following tips will help you save your time with only one click.</p>
<p>We will do the same way with expand and collapse the Flows:</p>
<ul>
<li>Add Bookmark the following code</li>
</ul>
<pre>
<code class="language-javascript">javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3Bvar%20connect%20%3D%20function()%7Bif(%24('.msla-selector').length%3E0)%7Bif(%24('.msla-selector').first().find('.msla-selector-list-text').length%3E0)%7B%24('.msla-selector').first().find('.msla-selector-list-text').first().click()%3BsetTimeout(connect%2C1000)%3B%7D%7D%7D%3Bconnect()%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.11.1%2Fjquery.min.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()</code></pre>
<p>Then the result will be: The connection LGT SQL Connection is auto reconnected.</p>
<img alt="Power Automate: Auto expand flows and auto reconnect" data-entity-type="file" data-entity-uuid="f133ece4-e4f1-4f35-9ece-46361c1a631f" height="403" src="/sites/default/files/inline-images/Image%203_4.png" width="695" class="align-center" />
<p> </p>
<h2><span style="color:#2980b9;">3. Conclusion:</span></h2>
<p>These tips are quite simple to do but its efficiency is high. So I hope these tips are helpful when you work with Flows. If you have any issues or feedback, please feel free to drop a comment.</p>
<h2 class="title">Power Automate: Auto expand flows and auto reconnect</h2>
</div>
</div>
Wed, 27 Oct 2021 08:40:20 +0000Nguyen Thanh Khoi485 at https://dynamics-chronicles.comPower Automatehttps://dynamics-chronicles.com/article/power-automate-auto-expand-flows-and-auto-reconnect-flows-after-import#commentsHow to access on premise resources with Power Automate
https://dynamics-chronicles.com/article/how-access-premise-resources-power-automate
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">How to access on premise resources with Power Automate</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/nguyen-thanh-khoi" lang="" about="/user/nguyen-thanh-khoi" typeof="schema:Person" property="schema:name" datatype="" class="username">Nguyen Thanh Khoi</a></span>
<span property="schema:dateCreated" content="2021-09-21T15:00:12+00:00" class="field field--name-created field--type-created field--label-hidden">Tue, 09/21/2021 - 17:00</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>How to access on premise resources with Power Automate</em></p>
<h3>1. Introduce</h3>
<p>The on-premises data gateway acts as a bridge. It provides quick and secure data transfer between on-premises data, which is data that isn't in the cloud, and several Microsoft cloud services. These services include Power BI, Power Apps, Power Automate, Azure Analysis Services, and Azure Logic Apps. By using a gateway, organizations can keep databases and other data sources on their on-premises networks while securely using that on-premises data in cloud services.</p>
<p>In this article, I will focus in set up and intergate On-permises data gateway and Power Automate.</p>
<h3>2. Data Gateway</h3>
<p>To start off, you will need to install a gateway on a machine that is in the same network as the SQL server. This machine must be <strong><em>always </em></strong>on and be <em><strong>always </strong></em>connected to the internet in order to be accessed from cloud.</p>
<p>P<a data-ved="2ahUKEwj_xpPV1bzxAhXiIqYKHdY2CqcQFjABegQIBhAD" href="https://www.oxfordlearnersdictionaries.com/definition/english/prerequisite_2#:~:text=%2F%CB%8Cpri%CB%90%CB%88rekw%C9%99z%C9%AAt%2F,or%20be%20done%20synonym%20precondition" ping="/url?sa=t&source=web&rct=j&url=https://www.oxfordlearnersdictionaries.com/definition/english/prerequisite_2%23:~:text%3D%252F%25CB%258Cpri%25CB%2590%25CB%2588rekw%25C9%2599z%25C9%25AAt%252F,or%2520be%2520done%2520synonym%2520precondition&ved=2ahUKEwj_xpPV1bzxAhXiIqYKHdY2CqcQFjABegQIBhAD">rerequisite</a>:</p>
<ul>
<li>.NET Framework 4.8</li>
</ul>
<p>How to install:</p>
<ol>
<li>Download the <a href="https://go.microsoft.com/fwlink/?LinkId=2116849&clcid=0x409">standard gateway</a> from Microsoft.</li>
<li>Set installation path and accept the terms of use then select <strong>Install</strong>.<img alt="install path" data-entity-type="file" data-entity-uuid="2fe56214-92d3-45dc-9abc-3ec491daad1c" src="/sites/default/files/inline-images/install-path.png" class="align-center" />
<p> </p>
</li>
<li>Sign in with your Office 365 account.<img alt="login Office 365 account" data-entity-type="file" data-entity-uuid="48ec00f0-a3cb-488e-afae-240b539fd8ee" height="400" src="/sites/default/files/inline-images/Image%204_2.png" width="437" class="align-center" />
<p> </p>
</li>
<li>Select <strong>Requester a new gateway on this computer</strong> and <strong>Next.</strong><img alt="install step 4" data-entity-type="file" data-entity-uuid="25332fe5-f7ba-4e26-ba54-84ece3aaf398" height="443" src="/sites/default/files/inline-images/Image%205_1.png" width="456" class="align-center" />
<p> </p>
</li>
<li>Enter a name for gateway and <strong>Configure</strong><img alt="install step 5" data-entity-type="file" data-entity-uuid="51ecd77c-59d9-4826-ab2f-5ea9264a8237" height="445" src="/sites/default/files/inline-images/Image%206_0.png" width="482" class="align-center" />
<p> </p>
</li>
<li>Check all information in final window.</li>
</ol>
<img alt="Final step" data-entity-type="file" data-entity-uuid="431c02c9-0b6d-4706-a5b2-c2d3c8d3908f" height="501" src="/sites/default/files/inline-images/Image%207_2.png" width="496" class="align-center" />
<p><em>Note</em>: <em>the account I used when configuring on-premises data gateway will be used to create flow.</em></p>
<h3>3. Integrate Dynamics 365 On-premises in Power Automate:</h3>
<p>In this section, I will show you how to create an Instant Flow that will do the 2 most common works:</p>
<ul>
<li>Retrieve data from Dynamics 365 On-Premises:</li>
<li>Create a new recrord in Dynamics 365 Online.</li>
</ul>
<p><strong>The example context</strong>: <em>I need to create an instant flow which is used in Canvas App. In the flow, I will access to Dynamics 365 On-premises to find an Account that contains specific text in name and create an Account record in Dynamics 365 Online.</em></p>
<p>This requirement will be done thanks to SQL Server Connector in Microsoft Flow and On-premises data gateway. We will access database of Dynamics 365 and perform action in the database. In Dynamics D365 On-Premises, the data will be store in a SQL Server database and each entity will be store in a table which name is: entity name + "Base". As you can see in the following picture, the table "AccountBase" will be store all record of entity Account</p>
<img alt="Snipet of DB" data-entity-type="file" data-entity-uuid="3f332e28-9131-42ab-8fb3-a9f2b956fc04" src="/sites/default/files/inline-images/Snipet%20of%20DB_0.png" class="align-center" />
<h4>Step 1: Create a Instant Flow</h4>
<p>First of all, you need login <a href="https://asia.flow.microsoft.com/en-us/">Microsoft Power Automate</a> homepage then choose My flows -> New flow and select Instant cloud flow.</p>
<img alt="Create Instant Flow" data-entity-type="file" data-entity-uuid="256a7d5d-e933-4586-9b15-88cba6cdfa98" src="/sites/default/files/inline-images/Create%20Instant%20Flow.png" class="align-center" />
<h4>Step 2: Connect to Dynamics 365 On-Premises via Data Gateway</h4>
<p>Search SQL Server action and add Get Rows (V2) action:</p>
<img alt="Find SQL Server" data-entity-type="file" data-entity-uuid="461719de-2cc6-4217-ae97-d68348e78fce" src="/sites/default/files/inline-images/Find%20SQL%20Server.png" class="align-center" />
<ul>
</ul>
<p>SQL Server has several actions and detailed of each acitions are provied at <a href="https://docs.microsoft.com/en-us/connectors/sql/#actions">SQL Server - Connectors | Microsoft Docs</a>.</p>
<p>You need to focus in 4 actions:</p>
<ul>
<li><strong>Insert Row (V2)</strong>: create a record in a table in the Database, which is corresponding to <strong>Add a new row </strong>action of Microsoft Dataverse.</li>
<li><strong>Get rows (V2)</strong>: find records in a table in the Database with a filtering, which is corresponding to <strong>List rows</strong> action of Microsoft Dataverse.</li>
<li><strong>Get row (V2)</strong>: find a row by id in a table in the Database, corresponding to <strong>Get a row by ID</strong> action in Microsoft Dataverse.</li>
<li><strong>Delete row (V2)</strong>: delete row in a table in the Database, which is corresponding to <strong>Delete a row</strong> action of Microsoft Dataverse. <em><span style="color:#c0392b;">You should be carefull with this action because it will modify database directly.</span></em></li>
</ul>
<img alt="SQL Server Action" data-entity-type="file" data-entity-uuid="e9e116cb-1a97-4fad-a664-ce86aa32a373" src="/sites/default/files/inline-images/SQL%20Server%20%20Actions.png" class="align-center" />
<ul>
<li>Configure Connection: Select Authentication Type then input name of SQL server and Database of Dynamics 365 On-premises, username, password. You will see the name of On-premises data gateway in previous configration step and select it then <strong>Create.</strong><img alt="create connection" data-entity-type="file" data-entity-uuid="c3218c47-fdab-4b47-b0cd-d8a76158667a" height="441" src="/sites/default/files/inline-images/Image%2023_0.png" width="501" class="align-center" />
<p> </p>
</li>
<li>Add filter query condition to Get rows (V2) action: In my context, I need to retrieve account which name contains <em>"knh".</em></li>
</ul>
<img alt="Get Row" data-entity-type="file" data-entity-uuid="fae6fd5c-2c10-4a7f-9422-de244cf31e80" src="/sites/default/files/inline-images/GetRow.png" class="align-center" />
<ul>
<li>Add a new row action (Microsoft Dataverse connector): fill all values that you want to migrate.</li>
</ul>
<img alt="Add new row" data-entity-type="file" data-entity-uuid="39c076a9-18c4-4bd6-aae3-a238263a4a71" src="/sites/default/files/inline-images/Image%201_2.png" class="align-center" />
<p> </p>
<p>The full flow will be as following picture:</p>
<img alt="Full flow" data-entity-type="file" data-entity-uuid="569f36b7-e3f0-4bbc-ac4d-a0b6233846ce" src="/sites/default/files/inline-images/Image%203_2.png" class="align-center" />
<p> </p>
<p>The result record in Dynamics 365 Online:</p>
<img alt="Result in Online env" data-entity-type="file" data-entity-uuid="d462bb10-e5ce-469e-832b-6f0bfd65382e" src="/sites/default/files/inline-images/Image%204_3.png" class="align-center" />
<h3>4. Conclusion:</h3>
<ul>
<li>Thanks to On-premises data gateway, we could access data in Dynamics 365 environment now. However, you could see that these steps and actions inflow are not easy and require a piece of knowledge about the architecture of Dynamics 365 as well as the database. </li>
<li>Microsoft provide a logging mechanism to monitor performance issue at <a href="https://docs.microsoft.com/en-us/data-integration/gateway/service-gateway-performance#slow-performing-queries">additional logging</a>.</li>
<li>SQL Server action connector limit to <strong>100 calls per 10 seconds </strong>as the <a href="https://docs.microsoft.com/en-us/connectors/sql/#limits">announcement </a>from Microsoft.</li>
</ul>
<h2 class="title">How to access on premise resources with Power Automate</h2>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2021-09/modestas-urbonas-vj_9l20fzj0-unsplash.jpg</div>
</div>
</div>
</div>
</div>
Tue, 21 Sep 2021 15:00:12 +0000Nguyen Thanh Khoi387 at https://dynamics-chronicles.comAPIAzureData ManipulationIntegrationPower AutomateTutorialhttps://dynamics-chronicles.com/article/how-access-premise-resources-power-automate#commentsPower Automate embedded in Power BI
https://dynamics-chronicles.com/article/power-automate-embedded-power-bi
<span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Power Automate embedded in Power BI</span>
<span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/amaury-veron" lang="" about="/user/amaury-veron" typeof="schema:Person" property="schema:name" datatype="" class="username">Amaury Veron</a></span>
<span property="schema:dateCreated" content="2021-06-29T06:15:27+00:00" class="field field--name-created field--type-created field--label-hidden">Tue, 06/29/2021 - 08:15</span>
<div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above">
<div class="field__label">Body</div>
<div property="schema:text" class="field__item"><p><em>Power Automate embedded in Power BI:</em></p>
<h3>Introduction</h3>
<p>Power BI is a great tool. And it is getting even better thanks to the effort made by Microsoft to integrate its softwares within each other. Today, we explore a new integration: the integration of Power Automate Flows into Power BI Reports !</p>
<p>Keep in mind that this is still a Preview functionality, but we hope it will get generally available soon.</p>
<p>Don't hesitate to check <a href="https://dynamics-chronicles.com/article/power-automate-dynamics-365">this Chronicle</a> to have information about Power Automate. </p>
<p> </p>
<h3>Quick Presentation</h3>
<p>The embedding of Power Automate is done with a Power BI visual.</p>
<p>The visual appears as a button on the Power BI Report. This button has an "Edit" functionality that opens the Power Automate Portal, fully embedded in Power BI Desktop. You can create a Power Automate Flow from there.</p>
<p>When the button is clicked, we can choose data to pass from the report to the Power Automate Flow. The data is contextual: only data filtered in the report is used ! Then you can do anything you want with this data in the Flow. You will only be limited by the power of Power Automate... which is a very powerful tool ! </p>
<p> </p>
<h3>Tutorial</h3>
<p>Now let's discover this integration with a tutorial.</p>
<p>We use a very simplified use case, the main idea being to discover the tools.</p>
<p>We have a Power BI Report linked to the Opportunity data of a CRM (The data comes from a demo environment of Dynamics 365). I have created a small report on this Opportunity data.</p>
<p>And in this report, we have buttons (our Power Automate visuals) that allow to qualify or disqualify the selected Opportunities. We will focus on the "qualify" button to see how it is done.</p>
<p>Here is the appearance of the final report:</p>
<img alt="Power Automate embedded in Power BI" data-entity-type="file" data-entity-uuid="6845015b-ff8c-40bf-8518-198634c87ee3" height="515" src="/sites/default/files/inline-images/Report%20finished.png" width="963" class="align-center" />
<p>You can see various visuals showing data about opportunities. In the bottom-right corner of the report, there are the 2 button corresponding to the Power Automate visuals. These two buttons trigger the Flows.</p>
<p>To add the Power Automate visual in Power BI when you don't have it yet, you can click the three dots in the "Visualizations" pane, and then add the "Power Automate" visual:</p>
<img alt="Power Automate embedded in Power BI" data-entity-type="file" data-entity-uuid="43e4a6d5-e35d-414c-9c6d-3a726986c630" height="521" src="/sites/default/files/inline-images/Add%20Power%20Automate%20Visual.png" width="971" class="align-center" />
<p> </p>
<p>Now, let's see how the buttons are implemented. </p>
<p>In the visual Power Automate, you can choose the fields to be passed to the Power Automate Flow:</p>
<img alt="Data passed into visuals" data-entity-type="file" data-entity-uuid="a96d8d5e-53c2-43b2-a548-4dc088237121" height="518" src="/sites/default/files/inline-images/Data%20passed%20into%20visual_2.png" width="967" class="align-center" />
<p>Here, we pass the fields "name", "estimatedvalue", "statuscode" and "opportunityid" of the Opportunity Table to the Flow.</p>
<p>By clicking the three dots on the button, and then "Edit", it opens the Power Automate Portal, fully integrated in Power BI! </p>
<img alt="Power Automate embedded in Power BI" data-entity-type="file" data-entity-uuid="c05861d4-e868-46f8-a052-4c47db63a9db" height="517" src="/sites/default/files/inline-images/Power%20Automate%20Portal.png" width="966" class="align-center" />
<p> </p>
<p>Below is the Flow used by the button:</p>
<img alt="Flow" data-entity-type="file" data-entity-uuid="6fb7151a-7e14-4bba-af66-d6b8ac02c5b8" height="527" src="/sites/default/files/inline-images/Flow.png" width="983" class="align-center" />
<p> </p>
<img alt="Power Automate embedded in Power BI" data-entity-type="file" data-entity-uuid="70f80bdb-599a-461e-a0fd-631485e8641c" height="533" src="/sites/default/files/inline-images/Create%20Close%20Opportunity%20Activity.png" width="991" class="align-center" />
<p> </p>
<p>So this is really the usual interface to create a Flow. Let's have a look at the steps in the Flow.</p>
<p>The trigger of the Flow isn't configurable. The trigger returns in output:</p>
<ul>
<li>The records filtered in the report</li>
<li>With fields passed in the button (as seen previously)</li>
</ul>
<p>Here is an example of the JSON in output:</p>
<pre>
<code class="language-json">{
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip,deflate",
"Accept-Language": "en-US,en; q=0.9",
"Expect": "100-continue",
"Host": "prod-65.westeurope.logic.azure.com",
"User-Agent": "Mozilla/5.0,(Windows NT 10.0; Win64; x64),AppleWebKit/537.36,(KHTML, like Gecko),Chrome/86.0.4240.198,Safari/537.36",
"origin": "ms-pbi://pbi.microsoft.com",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"X-MS-APIM-Referrer": "https://europe-002.azure-apim.net/apim/logicflows/81E86A9F3CC04EE9B5CD56F6D3C2E249-2BFE0D5665436769/triggers/manual/run?api-version=2016-06-01",
"x-ms-client-region": "europe",
"x-ms-flavor": "Production",
"x-ms-gateway-object-id": "",
"X-MS-APIM-Tokens": "*sanitized*",
"X-MS-APIM-Referrer-Prefix": "https://europe-002.azure-apim.net/apim/logicflows/81E86A9F3CC04EE9B5CD56F6D3C2E249-2BFE0D5665436769",
"X-MS-APIM-Callback": "https://europe-002.consent.azure-apim.net",
"x-ms-user-id": "969423b1-5adf-4684-be0b-c006b83b89fd",
"x-ms-user-name": "System Administrator",
"x-ms-user-name-encoded": "U3lzdGVtIEFkbWluaXN0cmF0b3I=",
"x-ms-user-email": "admin@CRM545215.onmicrosoft.com",
"x-ms-user-email-encoded": "YWRtaW5AQ1JNNTQ1MjE1Lm9ubWljcm9zb2Z0LmNvbQ==",
"x-ms-user-timestamp": "2021-06-21T06:06:34.1327471Z",
"X-Forwarded-For": "92.184.110.172",
"Content-Length": "536",
"Content-Type": "application/json"
},
"body": {
"entity": {
"Power BI values": [
{
"name": "10 orders of Product SKU JJ202 (sample)",
"estimatedvalue": 22000,
"statuscode": 1,
"opportunityid": "774C29E4-4BB0-EB11-8236-000D3AB6F6C0"
},
{
"name": "4G Enabled Tablets",
"estimatedvalue": 3257500,
"statuscode": 1,
"opportunityid": "BE0E0283-5BF2-E311-945F-6C3BE5A8DD64"
},
{
"name": "Audio",
"estimatedvalue": 747000,
"statuscode": 1,
"opportunityid": "BC0E0283-5BF2-E311-945F-6C3BE5A8DD64"
},
{
"name": "Audio Output",
"estimatedvalue": 0,
"statuscode": 1,
"opportunityid": "B80E0283-5BF2-E311-945F-6C3BE5A8DD64"
}
]
}
}
}</code></pre>
<p> </p>
<p>Then, for each entity returned, we create a "Opportunity Close Activity" record. (This is how an Opportunity can be closed, not directly by updating the Opportunity). You can maintain the "Ctrl" key to click the Button in Power BI Desktop.</p>
<p>And that's basically all! In a very quick time, we are able to create actions in a Power BI report using Power Automate !</p>
<p>Here, we use a simplified use case in which we qualify opportunities. But the amount of use cases could be infinite, have fun!</p>
<p> </p>
<h3>Limitations</h3>
<p>Here are 2 limitations that I could spot:</p>
<ul>
<li>The Power Automate Flow created with this method is created in the Default Environment of Dataverse. The environment can't be changed. This is probably because Power BI stands at the tenant level, and not at the environment level.</li>
<li>I could not find the Dataverse connector in the Power Automate embedded. It could be due to the fact that the Flow is in the Default Environment. I guess the connector will be made available soon. So for the tutorial, I used the Dynamics 365 connector (which will be deprecated in the future).</li>
</ul>
<p> </p>
<p>This integration is still in Preview, but we hope that it will be Generally available soon.</p>
<p> </p>
<h3>Licenses</h3>
<p>The licenses depend only on what you want to do with Power BI and Power Automate. There is no additional license required for using the Visual to integrate Power Automate into Power BI.</p>
<p>You can check the licences of Power Automate <a href="https://download.microsoft.com/download/9/5/6/9568EFD0-403D-4AE4-95F0-7FACA2CCB2E4/Power%20Apps%20Power%20Automate%20and%20Power%20Virtual%20Agents%20Licensing%20Guide%20-%20May%202020.pdf">here</a>. And the licenses of Power BI <a href="https://powerbi.microsoft.com/en-us/pricing/">here</a>.</p>
<p> </p>
<h3>Conclusion</h3>
<p>This integration of Power Automate in Power BI allows to extend the functionalities of a Power BI report by creating actions from it. It is really simple to put in place, and it can bring great enhancement to a Power BI Report.</p>
<p>I recommend having a look at it and keeping it in mind when designing IT solutions !</p>
<h2 class="title">Power Automate embedded in Power BI</h2>
</div>
</div>
<div class="field field--name-field-image field--type-image field--label-above">
<div class="field__label">Image</div>
<div class="images-container clearfix">
<div class="image-preview clearfix">
<div class="image-wrapper clearfix">
<div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2021-06/Cover%20Picture%20-%20Do%20More.jpg</div>
</div>
</div>
</div>
</div>
Tue, 29 Jun 2021 06:15:27 +0000Amaury Veron364 at https://dynamics-chronicles.comData ManipulationIntegrationPower AutomatePower BIReportingTutorialhttps://dynamics-chronicles.com/article/power-automate-embedded-power-bi#comments