Posts

Showing posts from May, 2020

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

Image
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)

Image
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

Image
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.
Problem:…

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

Image
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…