Category Archives: CloudFlows
Automatically Update Lookup Fields in Dynamics 365 Using Power Automate: From Custom Tables to Standard Entities
Imagine this: you update a product’s purchase date in a registration record and—boom—a related case automatically gets refreshed with the accurate “Purchased From” lookup. Saves time, reduces errors, and keeps everything in sync without you lifting a finger. Let’s walk through how to make that happen using Power Automate. The goal: When a Product Registration’s cri_purchasedat field is changed, the system will retrieve the related “Purchased From” record and update any linked Case(s) with the appropriate lookup reference. Let’s break down the step-by-step process of how this is done in Power Automate. Step 1: Trigger the Flow When Purchase Date Changes Flow trigger: When a row is added, modified, or deleted (Dataverse) This setup ensures that our flow only fires when that specific date field is modified. Step 2: Pull in the “Purchased From” Record Next, use List rows on the “Purchased From” table with a FetchXML query. We’re searching for a record whose name matches the updated cri_purchasedat. Set Row Count to 1, since we expect only one match. 3. Identify Any Linked Case Records Add another List rows action, this time on the Cases table. We look for records where cri_productregistrationid equals the current product registration’s ID:We now use the List Rows action to fetch all related Case records tied to the updated Product Registration. This time we’re targeting the Cases table (which is internally incident in Dataverse) and using a FetchXML query to match records where cri_productregistrationid equals the current record being modified. This step is critical because it gives us the list of Case records we need to update, based on the link with the modified product registration. <fetch> <entity name=”incident”> <attribute name=”incidentid” /> <attribute name=”title” /> <attribute name=”cf_actualpurchasedfrom” /> <filter> <condition attribute=”cri_productregistrationid” operator=”eq” value=”@{triggerOutputs()?[‘body/cri_productregistrationid’]}” /> </filter> </entity></fetch> 5. Before updating anything, we add a Condition control to ensure that our previously fetched Purchased From record exists and is unique. Why? Because if there’s no match (or multiple matches), we don’t want to update the Cases blindly. We check if this length equals 1. If true → move forward with updates.If false → stop or handle the exception accordingly. To conclude, this kind of validation builds guardrails into your automation, making it more robust and preventing incorrect data from being applied across multiple records. After confirming a valid match, the flow loops through each related Case and updates the “Actual Purchased From” field with the correct value from the matched record, ensuring accurate linkage based on the latest update. Once this step runs, your staging automation is complete—with Cases now intelligently updated in real-time based on Product Registration changes. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.
Share Story :
Automated Email Reminders Based on Date Fields in Power Automate for Dynamics 365 CRM.
Managing reminders and deadlines can be tricky, especially when you’re juggling multiple tasks in Dynamics 365. But what if you could set up automatic email reminders based on specific dates? In this guide, I’ll show you how to use Power Automate with D365 CRM to send automatic email reminders when certain dates are entered, and follow up at 7, 14, 21, and 28-day intervals if another related date field isn’t filled. By the end of this post, you’ll learn how to create a simple workflow that keeps your team on track by sending timely reminders when needed. The Use-Case: Automatic Email Reminders for Unfilled Dates Imagine this: Your Project Manager fills in a date for a project milestone. But if the next milestone isn’t updated after a set period, your system will automatically send reminder emails to the right people. This saves your team from having to manually follow up and ensures that important dates are never overlooked. Here’s how you can set it up using Power Automate: Key Components of the Solution Follow the Power Automate step outlined below: Select the “When a row is added, modified or deleted” trigger from the Dataverse connector, set the Change Type to Modified, choose the Order Fulfillments table, set the Scope to Organization, specify the columns cf_submittalprotocolprocess and cf_initialshopdrawingssubmitted to trigger only on changes to those fields, and optionally use the Filter Rows field to apply additional conditions if needed. Click the ellipsis (three dots) on the top-right corner of the trigger card, select Settings, scroll to the Trigger Conditions section, and enter the following expression to ensure the flow only triggers when cf_initialshopdrawingssubmitted is not empty: Below is the condition that you need to add: @and( not(empty(triggerOutputs()?[‘body/cf_initialshopdrawingssubmitted’])), equals(triggerOutputs()?[‘body/cf_submittalprotocolprocess’],979570001) ) Add the “Get a row by ID” action from the Dataverse connector, set the Table Name to Opportunities, and use the dynamic value Opportunity (Value) for the Row ID to retrieve the corresponding Opportunity record related to the modified Order Fulfillment. Add the “Get a row by ID” action from the Dataverse connector, set the Table Name to Order Fulfillments, and use the dynamic value Order Fulfillment for the Row ID to retrieve full details of the modified Order Fulfillment record. Add a “Compose” action named Comments for Email, and provide a formatted list including Project Manager (Order Fulfillment), Opportunity Contact, Secondary Contact, a static email (e.g., testblog@gmail.com), and again Project Manager (Order Fulfillment) as an example. Add a “Filter array” action, set the From field to a coalesce(…) expression generating a list of participants, and in Basic Mode set the condition to Item is not equal to null to remove null entries. Use a coalesce(createArray(…)) expression to conditionally construct an array of activity parties based on field availability (Opportunity Contact, Secondary Contact, Owner ID, Project Manager), falling back to a default address (CRMAdmin@gmail.com) if the Project Manager is null. coalesce( createArray( if( not(equals(outputs(‘Get_Opportunity_by_ID’)?[‘body/_cf_opportunitycontact_value’], null)), json(concat( ‘{“participationtypemask”: 2,”partyid@odata.bind”: “contacts(‘, outputs(‘Get_Opportunity_by_ID’)?[‘body/_cf_opportunitycontact_value’], ‘)”}’ )), null ), if( not(equals(triggerOutputs()?[‘body/_ow_secondarycontact_value’], null)), json(concat( ‘{“participationtypemask”: 2,”partyid@odata.bind”: “contacts(‘, triggerOutputs()?[‘body/_ow_secondarycontact_value’], ‘)”}’ )), Null ), if( not(equals(triggerOutputs()?[‘body/_ownerid_value’], null)), json(concat( ‘{“participationtypemask”: 3,”addressused”: “testblog@gmail.com”}’ )), null ), json(concat( ‘{“participationtypemask”: 4,”partyid@odata.bind”: “systemusers(‘, outputs(‘Getting_Order_Fulfillment_by_ID’)?[‘body/_cf_projectmanager_value’], ‘)”}’ )), if( not(equals(outputs(‘Getting_Order_Fulfillment_by_ID’)?[‘body/_cf_projectmanager_value’], null)), json(concat( ‘{“participationtypemask”: 1,”partyid@odata.bind”: “systemusers(‘, outputs(‘Getting_Order_Fulfillment_by_ID’)?[‘body/_cf_projectmanager_value’], ‘)”}’ )), json(concat( ‘{“participationtypemask”: 1,”addressused”: “CRMAdmin@gmail.com”}’ )) ) )) Switch to Advanced Mode in the Filter array and use the expression @not(equals(item(), null)) for better control over null filtering of the dynamic participant list. In the step below, I used a “Compose” action to extract the Project Manager’s ID, which is then used in the filter array step. Below is the body of the Filter Array, which I’ve saved in a new Compose action named “Email Participants.” Add a “Compose” action to generate the email body using HTML formatting, apply an if() expression to dynamically insert the recipient’s name, and use concat() to list the required items for fabrication. Below is the expression I used to identify all the recipients who will be receiving the emails. if( not(equals(outputs(‘Get_Opportunity_by_ID’)?[‘body/_cf_opportunitycontact_value@OData.Community.Display.V1.FormattedValue’], null)), concat(‘<strong>’, outputs(‘Get_Opportunity_by_ID’)?[‘body/_cf_opportunitycontact_value@OData.Community.Display.V1.FormattedValue’], ‘</strong>’), null After completing the previous steps, add a parallel branch with four parallel actions, each configured to send the email after a delay of 7, 14, 21, and 28 days, respectively. After introducing a 7-day delay, add a parallel branch that retrieves the corresponding Order Fulfillment record by ID and checks if both the Drawing Approval Date and Redline Issued Date fields updates have been made since the initial trigger Add the “Add a new row” action from the Dataverse connector, set the Table Name to Email Messages, populate the Activity Parties field using the dynamic output outputs(‘Email_Participants’), and map the Description field similarly with the appropriate output value containing the email body content. Set the Regarding (Order Fulfillments) field in the “Add a new row” action to the dynamic value Order Fulfilment (cf_orderfulfillment) to associate the email with the corresponding Order Fulfillment record. This is how the final power automate will look like Similarly, you can do for 14,21 and 28 days. Below is how the email would look like in CRM: The trigger will start when Initial shop drawings field contains the date field and Submittal/protocol process equals certain option. If both Redline Int Received and Drawing Approved Date fields remain empty after 7, 14, 21, and 28 days, CRM will automatically send a follow-up email on each of those days. This is how the email will look like. To conclude, setting up this automatic reminder system in Power Automate for D365 CRM will help your team stay on top of project milestones, reduce manual follow-ups, and make sure nothing gets overlooked. It’s a simple yet effective way to automate reminders and keep everyone informed without any extra effort. Hope this helps!!! We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com
Share Story :
Trigger Power Automate Flow using JavaScript – Bi-Directional
Hi All, This blog will be a continuation of my previous blog – Trigger Power Automate Flow using JavaScript – Uni Directional Now, feedback is essential when sending a request to determine whether it was successfully performed or failed somewhere. You can accomplish this by forwarding a response back from where the flow was invoked. I’ll use the same situation as in my previous blog, where I send a notification by greeting a person’s name if exists, or else I will greet a friend. Check out my previous blog to learn how to build your Flow and JavaScript. Steps to pass the response back within Flow Step 1: Add a response that will be sent back from where the Flow was invoked. Quick Tip: I am checking if ‘Name’ is present in my dynamic content. If yes, then greet the person else greet a Friend Formula: if(contains(triggerBody()?[‘DynamicData’], ‘Name’), triggerBody()?[‘DynamicData’][‘Name’], ‘Friend’) Steps to add into the JavaScript Step 1: Initially we created JS to trigger the flow, now we will add the code snippet to accept the response from Flow. Add the following Code: Step 2: Trigger the JS and watch the output I get as Alert (I have used the console page to trigger my JS for example purposes) Hope this helps in achieving a response from the Power Automate Flow!
Share Story :
Download SSRS report as a PDF with Power Automate – Part 2
In this blog, we will see how to extract the value for PdfDownloadUrl so we can load it into another request and get our PDF.
Share Story :
Get Option Set Labels in Power Automate flows
Every Option set Option has two Values associated with it : Label Value – which is a free text field. Value – Which is an integer value as In any Power Automate flow by default, we only get the integer value of an Option Set Option. In this blog let’s see we can get a Label of an Option Set Option. On my Accounts in CRM, I have an Option set Account Type. I have used a Get row by ID Action to get the Account Record whose Account Type Label I need to get. The next step is to check the Raw outputs of this Trigger Action and search for your Option Set field name. You will see 2 values in the body of the Raw outputs as shown below. Expression : outputs(‘Get_Account’)?[‘body/cfs_accounttype@OData.Community.Display.V1.FormattedValue‘] Gives the Label: Business Combination. Expression : outputs(‘Get_Account’)?[‘body/cfs_accounttype’] Gives the Value: 224520002. Inputs: Output : Hope this helps ! Thank you.
Share Story :
Get year from Current date & Time function in Cloud Flows
We wanted to get the current year but there is no direct expression only to get the year. Below is the solution where we get the current year. Use formatDateTime function function with Utcnow(). Below is the expression we used. formatDateTime(utcNow(),’yyyy’) Output – Expression to get current date formatDateTime(utcNow(),’dd’) 2. Expression to get the current Month formatDateTime(utcNow(),’MM’) Hope this helps!
Share Story :
Dynamically storing MS Forms Drop down field values into D365 CRM Option Set using Power Automate Flow
MS Forms offers a functionality to create a dropdown field which is similar to an option set fields in D365 CRM, But when it comes to mapping or storing values between these two field things become a bit tricky. However there are a few workaround using power automate capabilities. In this blog let’s see how we can store a MS Forms Dropdowns options into an Option Set field in CRM. What is an Option Set? Option sets are a field type that can be created within Dynamics CRM and are Often referred to as “dropdown” or a “pick-list”. An option set has two identities for each of its option. The Options Label Name and the Label Value as shown in the below snapshot. What is a Dropdown in MS Form ? A dropdown is a list of defined options(Choice) that can be selected by a user, unlike a text field where the data can be “organic” or manually entered. Now Let’s Consider an use case : Consider we have a MS Form Name “Company Registrations” when a user submits this form a Power Automate flow is triggered which creates a new Account record in CRM with the field mapping shown in similar colors in the below snapshot. Now we need to get the form responses first to create a new Account record. 2. All the Text field values can be directly mapped into the dataverse connector as shown in the below snapshot. 3. For mapping the MS forms Dropdown to the Option set we need to maintain the CRMs Option Label values into our flow as to set (define the value of the option set) Option Sets in CRM we need to pass the Label Values to the flow (if you just pass the label text it won’t work hence we need to maintain these option set values in the flow)as shown below. 4. Now we need to select the option set field in our flow connector and select enter custom value. 5. Once you are able to add a customer value use the following expression which will dynamically bring option set label value for the dropdown choice selected by the user on the form.Expression – outputs(‘Option_Set_Values’)?[outputs(‘Get_Form_Response’)?[‘body/rf98dd4fb83624fc7b7314de77542a3ef’]]Red : Text in the above expression corresponds to “Outputs “in the below snapshot which is the output of the compose in which we stored our option set label values. Blue : Text corresponds to the “Ownership Type” from the form response. Output : MS Form Submission – Created Account Output – Hope this helps !
Share Story :
Creating HTML table using Power Automate
The Create HTML Table action in Power Automate is a useful tool, but lacks any formatting or styling options. In this blog, we’ll see how to create a HTML table in Power Automate. Use Case: When quote is marked as won, close opportunity as won and send Email to the owner of the Opportunity with below details – Email Subject – Opportunity Won! Email Body – Customer Name – Below Table- Solution:Step 1-The requirement is quote should be modified and marked as Won. Trigger on When Quote Modified. Step 2- Initializing the customer with variable actions Step 3- Put a condition that the trigger works only when quote is Won (status code=4), then change opportunity to Won. Step 4- On quote status marked as Won, update the opportunity as Won. Step 5- Listing Accounts associated with Opportunity Step 6- Use Compose: Data Operation and enter the required record URL. Edit the Id by entering the opportunity Id from dynamic content. Similarly for quote URL details as well. Step 7- Using select operation to create a required table in the given format. Using href tag place the outputs of opportunity link and quote link in the key section respectively. Step 8- Create a HTML table and enter the output table of select operation. Step 9- Create 3 new steps using Compose operation to remove the unrequired part of the URL using replace expression. Step 10- Create a new step using compose operation and enter the required CSS style for the table to be sent in the mail and attach the final output in the inputs. Step 11- Send an Email and enter the final output in the Email body. Step 12- Email sent This is how we create HTML table in Power Automate. Hope this helps!!
Share Story :
Read items from Array in Power Automate
Let us consider we have array [1,2,3] and want to read each value in Power automate. Let see how we can read array in Power Automate Step 1- Create array (here you can use your array) Here I have array [1,2,3] and now I want read each value of array in loop Step 2 – Add apply to each step In a apply to each step, Add output of array. In this case we have compose. Step 3 – Add action compose and use expression item() to read array from compose Now Save and try to run the flow. In this way you can read value from array in Power Automate
Share Story :
Create HTML Table from SharePoint List using Cloudflows
Introduction: In this blog we are going to see how we can create an HTML Table from SharePoint List. Here is an example of SharePoint List. Solution: You can trigger the flow as per your requirment. Also, in this example I am retrieving all items in the list, there are filter options avaliable. Use action: Get Items We will first initialize an array variable and then append all list values to array variable in loop. Finally we create an HTML Table from the Array. Conclusion: As per your requirment, you can populate the values in document instead of creating HTML table. Send the HTML table or Word Document in Email.