Tag Archives: Microsoft Flows
Integrate Customers from Shopify with D365 for Finance and Operation using Microsoft flow
Using Microsoft flow you can automate and organize the flow of data between your Shopify and Microsoft D365 for Finance and Operation This the 1st part of 2. In this, I will show you how customers can be auto-created in D365 for Finance and Operation when it’s created in Shopify. First, log into Shopify as Admin. Navigate to: Settings -> Notifications -> Webhooks (Scroll to the end) -> Create Webhooks and select customer creation, and JSON format. We need a URL for sending customer details, which we will provide later. Now login to power apps or Microsoft automate with D365 account. Navigate to Flows -> New and select Instant from Blank. Now continue as shown in the below screenshots. Here the required URL will be generated after the flow has been saved. Click on the new step and search for Parse JSON. In Content select Body (parameter from previous steps). Now we need JSON schema for customers. You can find a sample Json return response from https://shopify.dev/docs/admin-api/rest/reference/customers/customer?api[version]=2020-04 Copy the response and select Generate from the sample in Powerapps and paste the response. The schema would be now generated. Click on ‘new step’. and search for Dynamics 365 for Fin & Ops. Click on Create record. Select the instance of the environment you want customers in and Entity name ‘CustomerV3’. Now you can place parameters from the previous step (Parse Json) in different fields such as. Mandatory fields that are required to create our customers are Customer account, Currency, Customer group, Company, Organization name. After the values are placed, click on Save at the top right corner. Now expand the first step and a URL will be there. Copy this URL to Shopify webhook and click Save webhook. Now let’s test this. Go to the customer’s section in Shopify and click Add Customer. Write the first name and last name for now and click save. Go to D365 F&O and navigate to All Customers. You should see a new customer created. In the next part, I will show how we can auto-create product in Shopify when created in D365 for Finance and Operation Thank you for reading!
How to use Expand Query in MS Flows
Introduction This blog explains how to use Expand Query (N:1 Relationship) in the Common Data Service List Records Connector. Steps to be followed: Initialize Variable of type string. Using Expand in list RecordsExpand Query: cf_Project($select=cf_projectname,cf_projectabbreviation) Here cf_Project is the Schema Name of Project Lookup field on location entity. Pass the field names of the project entity that you want. Here I have passed cf_projectname and cf_projectabbreviation. Result of list record: You can see we get Project value in the below format to use this we have to parse the JSON. “cf_Project”: “{\r\n \”cf_projectname\”: \”Client Commercial\”,\r\n \”cf_projectabbreviation\”: \”CC\”,\r\n \”cf_pmtrackerid\”: \”3b576605-9c82-e911-a839-000d3a07f695\”\r\n}” Retrieving Project Values. Use “Apply to each” to get the value of the Project. Pass “Value” of “List Records” from Dynamic Content in “Select an output from previous steps” Now Set the Value in the “Project” variable which we had initialized earlier. Go To Expression and type: items(‘Apply_to_each’)[‘cf_Project’] Note: Here “cf_Project” is what we had retrieved in the output of ‘list records’. Make sure you pass this value correctly. “cf_Project“: “{\r\n \”cf_projectname\”: \”Client Commercial\”,\r\n \”cf_projectabbreviation\”: \”CC\”,\r\n \”cf_pmtrackerid\”: \”3b576605-9c82-e911-a839-000d3a07f695\”\r\n}” Result of Project Variable: Parsing JSON. Use “Parse JSON” action Add “Project Variable” in Content from “Dynamic Content” Click on “Generate from sample” to generate JSON Schema Enter sample JSON payload and click on done. { “cf_projectname”: “Test Project”, “cf_projectabbreviation”: “TR”, “cf_pmtrackerid”: “3b576605-9c82-e911-a839-000d3a07f695” } It will generate a JSON Schema automatically. Using Project Values. After parsing Json successfully you can use the values of the project entity field. You can use “Compose” to get and check the value. Enter “cf_projectname” in “Compose” inputs. OutputEntire FLOW: NOTE: You can add multiple expand queries in List Record:Query: cf_Project($select=cf_projectname,cf_projectabbreviation),cf_ParentLocationId($select=cf_name)
Secure Input/Output in Power Automate Run History
Isn’t it just too easy to see from Flow (Power Automate’s) Runs what data was passed on? A simple switch in the Power Automate designer will secure this. Default Behavior By default, if you have access to the Flow, you can simply go in and see the inputs Secure Input / Output In the Flow designer, you can select and step and go to Settings And turn on Secure Input / Output depending on what you want. It says this is still in Preview as of the day of writing this post. Once this is Active, it is denoted by a Lock symbol on the step you enabled it on. And now, when you try to look at the data, it will hide away the information Note: Please note that this will run only for the Run History records after this was turned on. The previous records will continue to show the data. Hope this helps!!
Enable Flow button on D365 Ribbon
This is a pretty simple tweak to either show or hide the Flow button on the entity Forms’ Ribbon. Flow Button Not Visible System Settings Navigate to Settings > Administration. Go to System Settings In System Settings, under Customization tab, look for Enable Microsoft Flow option. You’ll be asked for permission Now, this is turned on Flow Button Visible Now, once you have enabled this setting, you’ll be able to see the Flow button on the View and Form ribbons across Dynamics 365 CE That was quick!!
Using “startswith” Filter Query in MS Flow
Introduction This blog explains how to use “startswith” filter query in MS Flow. Use Case Using MS Flows to retrieve the bunch of students who’s mobile numbers begin with +91 and send them a text (using Twilio connector) regarding the Top Indian Universities. The “starts with” filter query in MS Flows allows to easily achieve this functionality. Steps to be Followed: We will use “Dynamics 365 – List records” Actions. Enter the Organization Name and select the entity. Filter Query: startswith(new_phonenumber,’+91′) “new_phonenumber” is the logical name of the field which stores the phone number of students. ‘+91’ is the value of phone number by which we want to filter the retrieved student list. Enter the above query in Filter Query: Run the flow to test.It will return all the students whose phone number starts with “+91”
Using “contains” Filter Query in MS Flow
Introduction This blog explains how to use “contains” filter query in MS Flow. Use Case Retrieve all the Accounts whose name contains ‘cloud’. Steps to be Followed: We will use “Dynamics 365 – List records” Actions. Enter the Organization Name and entity.Filter Query: contains(name,’cloud’) name is the logical name of the field which stores the account name. ‘cloud’ is the value of account name by which we want to filter the retrieved account list. Enter the above query in Filter Query: Run the flow to test.It will return all the account whose name contains “cloud’.
Run OnDemand Workflow in D365 CE UCI Apps
Introduction: This blog explains the steps on how to enable OnDemand Workflow in D365 CE UCI Apps. Scenario: After clients are upgraded to D365 CE V9 version, Users are unable to use Classic App functionality to run OnDemand Workflows which was showstopper since it was routine task and much needed functionality. Steps: Below are steps to be performed for enabling functionality 1. Admin user should enable the “Microsoft flow” option for all the users. Below are the steps: Navigate to the ‘users’ in Office 365. Post navigation, open a specific user. Enable license for “Flow for Dynamics 365” in D365 CE Plan. (below screenshot for reference). 2. Enable setting to Show Microsoft Flow in Sitemap. Navigate to Settings → Administrator →System Settings by System Administrator Role User. Open Customization Tab and Enable Microsoft Flow option. 3. Navigate to any Entity below screenshot for Account. Open Account Entity record. Navigate to Flow button on Ribbon and expand options, you will view all OnDemand Workflow for Entity under Run Workflow header. Conclusion: This is how enabling Microsoft Flows setting on specific environment allows Users to run OnDemand Workflows in UCI Apps of D365 CE. Hope the above process helps!
Create Folder Structure in SharePoint using MS Flows
Introduction: In this blog we will see how we can create folder structure in SharePoint for Leads when the record is created in CRM using MS Flows Pre Requisites: SharePoint Integration must be enabled for the required entities Implementation Step 1: Here in our Flows we have used “Create of a record(Leads)” as trigger condition. Step 2: Then we create the folder structure in SharePoint using the “Create File” action Here we will create a text file which can be deleted later if not required. Folder Path: /Lead/Topic_toUpper(replace(triggerBody()?[‘leadid’],’-‘,”)) Here “Topic” is Dynamics value and for the record ID copy paste the expression written above in the Expressions tab and add it at the end of the Folder Path. After we have created the folder structure if the file is not required we can delete the text file by adding the delete step as shown below Step 3: We will also store the Folder ID in a variable “FolderId” to use in the later steps Step 4: Now we will create the same folder structure in CRM (Document Location) Here for the parent site or Location we have we have added the GUID of the Parent Document Location site for Leads. We can get this from the URL of the Parent Document Location record from Advanced Find (Document Location Entity) Lead document location record URL: https://org.crm8.dynamics.com/main.aspx?etc=9508&extraqs=%3f_gridType%3d9508%26etc%3d9508%26id%3d%257b1957C431-5F15-E911-A96F-000D3AF29269%257d%26rskey%3d%257bF5B008AC-07D9-4554-8509-2C05767BFF51%257d&histKey=17520860&newWindow=true&pagetype=entityrecord&rskey=%7bF5B008AC-07D9-4554-8509-2C05767BFF51%7d#371473802 Step 5: Similarly we can also create sub folders within the main folder as per the requirements Hope this Helped!
Error handing in MS Flows
Introduction: In this blog we will be going through the steps of Error Handling in Microsoft Flows. Implementation: Step 1: We have created a basic flow that is triggered when a HTTP POST Request has be made to the generated URL. The body will contain a JSON array with some data The flow will then take the data passed in the POST request body and for each object in the JSON array, it create a record in Dynamics 365 Customer Engagement as shown below. In the above scenario we pass the correct data, but in case the data that is passed to the URL is not correctly formatted or the data is missing we will encounter an error and the flow will fail. To handle such situations we will define an action that will take place when an error is encountered. Step 2: To Log the error, we will create another action to create a log error log in Dynamics 365 Customer Engagement. To make sure that this is created only when an error is encountered we click on the Configure Run After option as shown There are four options shown, here we select only the “has failed” option which states that the log will be created when there is a failure. Once this is done we can see the the flow shows a dotted red line for the last step, this is because the “Log Error in CRM” action will run only in one scenario i.e. when the above action has failed. The benefits of using this approach in our flows is that we can log all the errors at one place and also store the error response of the previous stage by simply selecting the Dynamic Content in the “Log Error in CRM” action.
Get Feedback from customers after Case is resolved using MS Flows
Introduction: In this blog we will use MS Flows to send out Surveys to customers once the Status Reason on the case is “Problem Resolved”. Implementation: Step 1: Below shown is the configuration of the flow. The flow is triggered once the Status Reason field in the case is changed. The statuscode is 5 which means “Problem Solved”. If problem is solved then we send a Survey form to the customer. Step 2: We then send an email to the customer as shown below We can also use the dynamic value by entering the “To” email id same as the one present on the Case. survey link details are mentioned in Step 3. Step 3: We have created a simple Survey using TypeForm once this is done a link will be created and the same can be entered in the Send email step. Then we add a step as shown below which will wait for the response . Firstly we sign in using own TypeForm account details and then Select the Survey from the dropdown and fill in the details as shown below. Once the response is received we have added a step to update the User details who was working on the case. We can create a custom field to store the responses received from the TypeForm step. Conclusion: This is useful to as we can improve customer service by easily by using MS Flows. We can also use Microsoft Forms, SurveyMonkey to create surveys and get responses