Build Efficient Flows Using Filter Expression in CDS (current environment) Trigger

One of the key best practices for creating an efficient automated flow in Power Automate (Dynamics 365 or Common Data Service) is to properly set the options on the trigger of the flow to minimise unnecessary triggering and reduce execution time. As specified in a guide to building enterprise-ready flows, you should always set attribute filters unless you are interested in any change to the record. Aside from the attribute filtering, there is also a Filter Expression parameter option in the Common Data Service (current environment) connector that you can use to filter records to process.
In this blog post, you will learn how to use the following functionalities in Power Automate. Filter Expression to filter further based on the value of the record and run the flow only for certain criteriaTrigger Conditions to filter as an alternative option, what are the differences and when to use itPeek code option to get the expression of the Dynamic contentGuard conditions to increase the…

Import Data Behaviour for Lookup Fields in Dynamics 365 (CDS)

There are several ways to import the data into Dynamics 365 or Common Data Service and one of them is using out-of-the-box Data Import Wizard. When the Import Data functionality is used to create the records, the system handles the lookup fields differently from the other types of data. If the lookup field requirement option is Business Required (Mandatory), the system resolves the lookup and set the value upon record creation Otherwise, the system creates all the records with an empty value in Optional lookup fields. Only after the whole import file is processed, the system resolves the Optional lookup fields and populate with data This behaviour is to avoid record import failure because of the lookup data dependency between each other. Let's go through the following examples of importing data for Account entity to understand better.
Scenario Outcome Field Requirement for …

Show Global Notification on Load of Model-driven App in Dynamics 365

Previously in the legacy web client, the system administrators used to see the system notification messages as below (which informs us about the mailbox alerts or users without security roles). Occasionally, the customers came up with the requirement to show certain warning message as soon as the user logs in to the system but there was no API for such application-level notification. Most of the time, we have to convince the customer to settle with a solution which involves creating a view for those records that requires the user's attention in a landing dashboard. In Unified Interface, we can now show such application-level notification using addGlobalNotification client API. This solution is inspired by the blog post about Global Notification written by Priyesh Wagh when the feature was still in preview. A few days ago, @PFEDynamics tweeted about it (I guess that is an announcement of general availability) and I thought for creating a solution with it.

Send Email from Dynamics 365/CDS with Attachment from Notes Using Flow

Automation of email sending out from the system is a common requirement in Dynamics 365 applications or model-driven apps for Common Data Service (CDS). The requirements of automated emails can be an approval email to the case owner, reminder email to the task assignee, status update email to the customer, etc. In some scenarios, automated email requires to include attachments from the Notes (annotation) related to the record or SharePoint files from the document folder of the record. Before I built my flow, I did a quick web search for the existing solutions. I found a few great tutorials on how to create an email with attachment in CDS using Azure Function or HTTP with Azure AD. Those blog posts inspired me to build my version of it and find out if it can be done with just CDS connector.
Problem: There are two Attachment entities in Dynamics 365 and CDS connector shows x2 "Attachments" in the entity selection list. When the entity name is chosen fro…

Upload SharePoint Documents for Dynamics 365/CDS Records Using Flow

In data migration from the legacy system to Dynamics 365, one of the common requirements that I have seen is the migration of the documents. Previously, we either have to develop our own .NET console application or use 3rd party tools. But now, we can leverage the Microsoft Power Platform to build the same mechanism using Power Automate instant flow.

In this blog post, you will learn how to achieve the following using the flow from Power Automate. create SharePoint Document Locations creation in Dynamics 365 or Common Data Servicemigrate documents to SharePoint folder of D365/CDS recorduse SharePoint connector actions such as List folder, Create new folder, Copy file The Use Case: The requirements for each document migration will be different but in this blog post, I will demonstrate the solution based on the following requirements. The files from the legacy system are placed into a shared network folder in which there are multiple subfolders Each subfolder contains the files for each Acco…

[Model-Driven Apps] Error code deciphering: ways to get the error description in Data Import Failure and Unified Interface Error Message Popup

When you encounter an error in Dynamics 365, the error is usually presented by an error code followed by a short error description that describes what went wrong. However, that is not always the case, there are instances where you will only be presented with an error code and no description of the error at all, and that is not helpful in identifying what had gone wrong.

Below are 2 scenarios I have encountered where I was only presented with an error code, followed by a couple of options on what to do and where you can get the description of the error codes pertaining to the scenarios.
Scenario 1 When importing data using Dynamics 365 Data Import Wizard, you will sometimes encounter an error for some of the records being imported. When you check the Import record, the system opens up the Import Source File form in Unified Interface and the description column is empty for the Failure records for some reason as in the screenshot below. With just an error code, it is not easy to figure o…