Creating a Case in Dynamics 365 Using Power Automate

For certain Power Automate will reduce the number of repetitive tasks that you and your team take on daily. It will help you automate the business process so that you can focus on more productive tasks saving time and energy. From the Organizations standpoint, Power Automate will make their resources more efficient and productive thereby enhancing business productivity and profitability.

Let’s see how to create a case automatically in Dynamics 365 when a customer reports an issue with a product.

From Office 365 Portal, click Power Automate.

You will be redirected to Power Automate window in a new tab.

Click My flows. This is the area where you can find all your previously created flows. Since we don’t have any, let’s create one by clicking +New.

You will see some dropdown options. Click Instant from blank.

Build an instant flow
window pops up. Give name to the flow and select the trigger as “When a HTTP request is received.”

Click Create. A case with the given name will be created. Here the case name is New Case Creation.

You have now selected an HTTP trigger. This trigger will fire from the webpage you connect to Flow. You must insert a JSON schema into the trigger.

Click and open the HTTP request. Insert the below JSON schema into the trigger.

{

"$schema": "http://json-schema.org/draft-04/schema#",

"type": "object",

"properties": {

"firstName": {

"type": "string"

},

"lastName": {

"type": "string"

},

"email": {

"type": "string"

},

"company": {

"type": "string"

},

"phone": {

"type": "string"

},

"city": {

"type": "string"

},

"state": {

"type": "string"

},

"country": {

"type": "string"

},

"product": {

"type": "string"

},

"description": {

"type": "string"

},

"referrer": {

"type": "string"

}

},

"required": [

"city",

"description",

"company",

"email",

"firstName",

"lastName",

"phone",

"country",

"state",

"product"

]

}


Create Account

At first, you need to create an account in the Dynamics CRM based on the company name entered by the customer.

Click New Step button. In the search box, type Dynamics and click Create a new record from the results as shown below.

In the create new record step, you are required to select Organization Name and Entity Name from the drop down.

Here the Organization Name is selected as MTC and Entity Name as Accounts. Further the box expands for you to enter more details.

In the Account Name field, choose the dynamics content as company.

Again click New Step. This time you need to create case.

Create Case

Following the above steps, selected Organization Name as MTC and Entity as Case which will further expand the box to add more details.

Choose the dynamic content as product for Case Title, accounts for Customer Type and description for Description. Save the flow.

You will notice that a HTTP POST URL is automatically generated. Copy this URL and paste on your web portal from where customers would access and notify their issues.

You can do a Flow Checker to check for errors and warnings.

Once everything is correct, you can do a test run and check if a case is automatically created in your CRM.

Here for test run, let’s consider the below testable web form.

<!DOCTYPE html>

<html>

<head>

<script>

window.onload = function () { document.getElementById("submitButton").onclick = submitForm;

};

function submitForm()

{

var xmlhttp = new XMLHttpRequest();

xmlhttp.open("POST","" POST URL goes in between these quotation marks*/);

xmlhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");

xmlhttp.send(JSON.stringify(

{

firstName: document.getElementById("firstName").value,

lastName: document.getElementById("lastName").value,

email: document.getElementById("email").value,

company: document.getElementById("company").value,

phone: document.getElementById("phone").value,

city: document.getElementById("city").value,

state: document.getElementById("state").value,

country: document.getElementById("country").value,

product: document.getElementById("product").value,

description: document.getElementById("description").value,} ));

alert("Thank you!"); /*This is just an additional check to verify the function worked*/

}

</script>

</head>

<p>First Name:</p> <input style="width: 300px;" id="firstName" type="text" />

<p>Last Name:</p> <input style="width: 300px;" id="lastName" type="text" />

<p>Email:</p> <input style="width: 300px;" id="email" type="text" />

<p>Company:</p> <input style="width: 300px;" id="company" type="text" />

<p>Phone:</p> <input style="width: 300px;" id="phone" type="text" />

<p>City:</p> <input style="width: 300px;" id="city" type="text" />

<p>State:</p> <input style="width: 300px;" id="state" type="text" />

<p>Country:</p> <input style="width: 300px;" id="country" type="text" />

<p>product:</p> <input style="width: 300px;" id="product" type="text" />

<p>Description:</p> <input style="width: 300px;" id="description" type="text" />

<p><input id="submitButton" type="button" value="Submit" /></p>

</html>

After clicking Submit, the flow will be triggered. You can check the flow status by selecting the flow and clicking Run history.
In the Run history, you will find all the flows triggered by you. You can get full details by clicking and opening individual item.


Since the flow status is successful, you can notice that a case record will be created in CRM.

Likewise, you can explore other potential business scenarios where flow can automate the business process and free you up.

In case of queries or more help, email us at salesteam@mtccrm.com

No Comments

Add a Comment

  1. (max length 2000)
  2. captcha refresh captcha