Set up rules to automatically create or update records in CRM

Overview

Every organisation has multiple applications to capture customer interactions. An ability to channel external data into the Microsoft Dynamics CRM records can significantly improve the efficiency of your sales, marketing, and service teams, and increase the quality of your data. You can now direct this data from various applications and external sources into Microsoft Dynamics CRM with the help of record creation and update rules.

By using the record creation and update rules in Microsoft Dynamics CRM, you can automatically create or update system or custom records from incoming CRM activities, such as emails, social activities, or custom activities without writing any code. Not just that, you can set up the rule to convert the incoming activity into multiple CRM records. For example, you can create a case and a lead from a single social activity.

A record creation and update rule consists of rule items that define the conditions for creating or updating records and also defines what actions or steps to take on the newly created records. The rule also contains channel properties that are used to define conditions for rules and also for setting properties of the record you’re creating or updating.

exclamationImportant

For Microsoft Dynamics CRM Online organizations, this feature is available only if your organization has updated to Dynamics CRM Online 2015 Update 1. Interested in getting this feature? Find your CRM administrator or support person. This feature is not available for Dynamics CRM (on-premises).

On this page:

billetpoint_arrow Activities and entities supported by record creation and update rules

billetpoint_arrow Capture data from external sources

billetpoint_arrow Activate or deactivate a rule

billetpoint_arrow How does record creation and update rule work with queues?

billetpoint_arrow Rules in solutions

billetpoint_arrow Prerequisites

billetpoint_arrow Set up a rule to create and update records automatically

billetpoint_arrow Set up channel properties

billetpoint_arrow Activate a record creation and update rule

billetpoint_arrow Manage automatic record creation and update from a queue form

billetpoint_arrow Upgrade considerations

 

Activities and entities supported by record creation and update rules

By default, CRM supports creating records from the following activities, also called as source types in the context of record creation and update rules:

  • Email
  • Social activity
  • Task
  • Phone call
  • Appointment
  • Service activity
  • Custom activity

These activities can be converted to any default (system) entity records or custom entity records. For example, you could create a lead, opportunity (system records) or incident (custom record) from an incoming email.

Capture data from external sources

You can also capture additional valuable customer information provided by an external application in the form of JSON (a collection of name-value pairs) and use it to enhance the quality of the target records and set various conditions in the record creation and update rules.

Every default (out-of-the-box) activity or custom activity has an Additional Parameters attribute. This attribute stores the JSON payload received from an external application.

To capture this information in CRM, you can define channel properties and associate them with a particular rule or share them across multiple rules of the same source type. For example, along with a social post, you can capture important information about the post such as sentiment value. Sentiment value is the property of social activity, so you can use this property in any other record creation and update rule of type Social Activity. .

Here’s the correct format in which CRM should receive JSON payload (data received as name/value pair in JSON format) from the external application:

{“PropertyName1”:”Propertyvalue1”; “PropertyName2”:”Propertyvalue2”}

noteNote

Any configuration done in the channel properties is only valid if those name value pairs exist in the JSON payload. Also, you must only use parameters received from the external application in the rule item conditions and as record properties.

Activate or deactivate a rule

For any records creation and update rule to apply to a matching incoming activity, after you add the rule items, you must activate the rule.

When a record creation and update rule is activated, a corresponding workflow is created automatically. You can use channel properties to define a workflow’s conditions and operators and in mapping the target entity attribute values. For complex scenarios, you may configure child workflows.

More information:  TechNet: Configure workflow steps

How does record creation and update rule work with queues?

In a record creation and update rule, when you specify a queue for a source type, any incoming activity from that source is added as a queue item for that specified queue. That is, if a rule for a particular source activity and queue combination is active, the rule processes the incoming activity on that queue to create or update records.

For an email source type, specifying a queue is mandatory. For all other source types including custom activities, it is optional.

Rules in solutions

The record creation and update rules can be packaged as a part of a CRM solution. Customizers and developers distribute solutions so that organizations can use Microsoft Dynamics CRM to install and uninstall the business functionality defined by the solution.

Keep the following things in mind about using rules in solutions:

  • Any new rule that you created in Microsoft Dynamics CRM Online 2015 Update 1 can’t be exported to an earlier release.
  • Any rules upgraded to and edited in Microsoft Dynamics CRM Online 2015 Update 1 can’t be exported back to an earlier release.

Prerequisites

  • For Microsoft Dynamics CRM Online organizations, this feature is available only if your organization has updated to Dynamics CRM Online 2015 Update 1. Interested in getting this feature? Find your CRM administrator or support person. This feature is not available for Dynamics CRM (on-premises).
  • Before you can use automatic record creation rules, make sure that your external application/social engagement system is already integrated with your CRM instance.

If your CRM instance meets the prerequisites, all you need to do is set up rules in CRM that will automatically create or update a support case, lead, opportunity, appointment, task, and more from incoming activities.

Set up a rule to create and update records automatically

green_diamond_arrow

  1. Make sure that you have the customer service, sales manager, or marketing manager role or equivalent permissions.
green_diamond_arrow Check your security role

a. Follow the steps in View your user profile.

b. Don’t have the correct permissions? Contact your system administrator.

  1. Go to Settings > Service Management or Business Management. (How do I get there?)
  2. Choose Automatic Record Creation and Update Rules.
  3. To create a new record creation and update rule, choose New.

-OR-

To edit an existing rule, in the list of rules, open the rule you want to edit.

  1. Type or modify information in the fields.

Hover over the field labels to see what to enter.

  • Name. Type the name of the rule.
  • Source Type. From the drop-down list, select the activity that’s the source of the record.
  • Queue. Select the queue that the rule applies to. Incoming activity arrives in the queue, and then the valid rule and rule item applies for creation or update of records.

Here are a few things to consider:

  • For all activities and custom activities, except email, specifying a queue is optional. For all such activities you can have only one rule with an associated queue and one rule without an associated queue active at any given time. For example, for a Social Activity source type, you can have two active rules, one with a queue specified, and one without a queue.
  • If you selected Email as the source type for this rule, you can’t activate the rule unless you select a queue.

noteNote

You can associate only one rule per source type to a specific queue. If you’re creating a rule to convert an email to a case, make sure you specify an email address for this queue. Otherwise, automatic record creation for email won’t work. More information: Create or edit a queue

  1. Choose Save.
  2. Under Channel Properties, in the Additional Properties box, choose a channel property group.

noteNote

When you select a property group for a record creation and update rule, you can use the channel property group’s property items in the rule item conditions or while setting properties for the target record. After you activate a rule, you can’t remove or change the selected property group. You can select another property group only once you remove the referenced property items of the previous property group from the rule items. When you try to select a new property group without removing the property references of the previous property group, you’ll see an error.

To learn more about creating new channel property groups and adding properties to it, see the Set up channel properties section in this topic.

  1. If the source type for the rule is set to Email, specify the conditions for converting the email to the target record.

green_diamond_arrow

Specify the following details

a. Create records for email from unknown senders. If you select this check box, all email messages from unknown senders (a sender whose email address isn’t present in any CRM records) are converted to new records (based on the conditions you define). A contact record is also created for this unknown sender.

noteNote

CRM determines what record to create based on the entity you select in the Create Record step under Actions.

If you don’t select this check box, records are created only for email messages that have a CRM contact or account as the senders.

This option, in conjunction with the Automatically create records in Microsoft Dynamics CRM option in the rule owner’s Personal Options, determines whether a case and contact record is created (see Set personal options).

b. Create case if a valid entitlement exists for the customer. If you select this check box, CRM creates a case only if an active entitlement exists for the customer.

If the sender of the email is a contact with a parent account, CRM creates a record if the contact’s parent account has a valid entitlement, and the contact is listed in the Contacts section of the entitlement or if the Contacts section is empty (which means the entitlement is applicable to all contacts for the customer).

c. Create cases for activities associated with a resolved case. If you select this check box, CRM creates a case if the email is related to a resolved case. If the email is related to an active case, a new case won’t be created.

d. Create case when the case associated with the activity is resolved since. If you select the Create cases for activities associated with a resolved case check box, select the duration here. CRM creates a case only if the case is resolved earlier than the duration you specify. If the incoming email is related to a case resolved later than the specified duration, CRM only associates the incoming email with the existing resolved case; a new case won’t be created.

e. Send automatic email response to customer on record creation. Select this check box if you want to automatically send email responses to the sender of the email after a target record for the email is created.

f. Select email template to respond to customer.  If you select the Send automatic email response to customer on record creation check box, select an email template (global email template or email template of any entity type). If you don’t select a template, an automatic response won’t be sent.

  1. If the source type for the rule is set to Social Activity, specify the conditions for converting the social activity to the target record.

green_diamond_arrow Specify the following details

a. Create records for blocked social profile. If you select this check box, CRM creates or updates a target record for the social posts (social activities) from social profiles that are blocked by you.

noteNote

Social posts appear in CRM as social activities.

b. Create records for direct messages only. If you select this check box, CRM creates or updates a target record only when the social posts are sent as direct or private messages. If the check box is cleared, cases are created for all social posts including public messages (timeline).

noteNote

CRM determines what record to create based on the entity you select in the Create Record step under Actions.

  1. In the Specify Record Creation and Update Details section, choose plus_sign to define the conditions for creating or updating a record and specify the properties of the record.

green_diamond_arrow

a. In the Name box, specify a meaningful name for the rule item.

b. In the Conditions section, select the record, channel properties, fields, and relational query operators to specify when a target record should be created or updated.

For example, to create a record from a social post (social activity) with a sentiment value of less than 3, an influence score greater than 60, and hashtags containing SilverCreditCard, you can add the following conditions:

channel_properties

You can also use channel properties in your conditions.

rule_item

Here’s the rule item after you add all the conditions:

steps

c. Add steps to create or update records for the incoming activity that matches the conditions you’ve defined earlier.

green_diamond_arrow

  • Under Actions, choose Add Step > Create record.
  • In the Create box, select the record type for the record you want to create from the incoming activity. For example, if you want to create a case from the social activity, select Case.
  • Choose Set Properties.

The entity form is displayed. You can map the target entity fields to the social activity record data, including channel properties. Some of the mappings are available out-of-the-box: Case title, Customer and Origin (highlighted in yellow). The out-of-the-box mappings can be changed and new mappings can be added using the Form Assistant control.

create_case

The new record that will be created will be automatically set as the regarding record of the incoming activity record. There is only one regarding object to the social activity, so, only one Create record action is possible in the Actions section.

  • To add more actions, under Specify Other Actions, choose Add Step > <Action>. The available actions are: Create Record, Update Record, Send Email, or Start Child Workflow.

Learn more about each of these actions in TechNet: Configure workflow steps.

d. Choose Save and Close.

noteNote

  • Data types “Option Set” and “Two Option” are not supported in string type conditions.
  • The property items for each of the supported data types need to a have default value. This requirement is important in scenarios where the configured property line items have a blank incoming web request. In such cases, the property line item will take the default value when referred to in a workflow.
  1. Turn on the rule so that CRM can start creating or updating records for incoming activities based on the defined conditions. More information: Activate a record creation and update rule.

tipTip

Developers can also apply rules retroactively to the incoming CRM records that might have been skipped while a rule was edited. More information:  MSDN: ApplyRecordCreationAndUpdateRuleRequest Class

exclamationImportant

If an incoming activity already has a regarding record set, and if the activity matches the conditions defined in the rule items, the regarding record will be updated. The properties defined for that record under the Actions section of the rule item form will be considered for updating the record.

Set up channel properties

Every default or custom activity has an Additional Parameters attribute. This attribute stores the JSON payload received from an external application.

You can find these parameters in the Additional Parameters field of any incoming activity.

To capture this information in CRM and associate it with the record creation or update rule, you can define channel properties in a channel property group and associate it with a particular rule or share them across multiple rules. For example, along with a social post, you can capture important information about the post, such as rating or influencer score. Rating and influencer score are the properties of social channel.

green_diamond_arrow

 

Create channel property groups and add channel properties

  1. Once you save the record creation and update rule form, under Channel Properties section, in the Additional Properties box, choose the lookup button, and then choose New.

additional_properties

A channel property group form opens.

exclamationImportant

A property group record contains multiple property items.

To fix this issue, first delete the properties from the conditions and steps that use the record, and then save or activate the rule.

  1. Enter a meaningful name for the property group, so you can easily identify it while adding it to any record creation or update rule.
  2. The Source Type field will be automatically set to the source type of the record creation and update rule.
  3. Choose Save.
  4. In the Channel Properties section, choose (+) to add in the group specific channel properties.
  5. In the Channel Property form, enter the following:

a. Name. Type the property name as it appears in the activity’s payload.

noteNote

The name can contain only alphanumeric and underscore characters and shouldn’t be longer than 300 characters.

To see properties received for an activity, go to Sales or Service or Marketing > Activities, and open the activity, and see the Additional Parameters field.

noteNote

This field isn’t available on the activity form by default. A system customizer can add the field to the activity forms. The field will have the JSON payload only when the external application sends it for the activity.

additional_parameters

exclamationImportant

a. Create a channel property for each name from the name-value pair that you want to use in your record creation and update rule. For example, you could use influenceScore as a property name.

b. The information in the JSON payload isn’t very easy to read. To make it more readable, you can use online JSON parser that will provide a better output.

c. The property group doesn’t support adding nested values in a JSON payload as channel properties. The following sample shows the “FollowersCount” under the user node as a nested JSON key-value pair.

JSON

d. Data Type. Select a data type for the channel property. For example, if the property is influence score, use the data type as Whole Number because its value can’t be in decimals.

The selected data type will determine the relational query operators when you use the property to define conditions in the record creation and update rule items. CRM supports creating properties only of the following data types: Floating Point Number, Single Line of Text and Whole Number.

noteNote

  • Option Set and Two option data types are supported in conditions of type string. You’ll have to type out the option set value in the conditions.
  • CRM sets a default value for property items for each of the supported data types. This is for scenarios when a channel property is used in a workflow but the incoming payload has no value provided from the external channel, the workflow conditions in which the property is referred use a least the following default value: String: “”, Whole Number: -2,147,483,648, Float: -1e+011

e. Application Source. Type the name of the application that this property is related to, for example, Microsoft Social Engagement.

f. Description. Type details to further explain what the property is for.

  1. When you’re done, choose Save & Close.

You can see all the properties in the channel property group form.

tweet_info

Activate a record creation and update rule

For any records creation and update rule to apply to a matching incoming activity, after you add the rule items, you must activate the rule.

green_diamond_arrow

To activate a record creation and update rule

  1. Go to Settings > Business Management or Service Management. (How do I get there?)
  2. Choose Automatic Record Creation and Update Rules.
  3. Open the rule that you want to activate, and on the command bar, choose Activate.

noteNote

You can have two record creation and update rule active at a time for any source type, except email—one with queue and one without a queue. You can have only one record creation and update rule active for the source type Email, and this rule should have a queue specified.

Once the rule is active, the only way to change the rule is to first deactivate it. Open the rule and on the command bar, choose Deactivate.

Manage automatic record creation and update from a queue form

You can create or manage an automatic case creation rule from a queue form, too. To do this, open the queue record, and on the command bar, choose Email Activity Conversion Settings or Social Activity Conversion Settings.

More information:   Create or edit a queue

Upgrade considerations

Here are a few things you should know if you’re upgrading to Microsoft Dynamics CRM Online 2015 Update 1 from an earlier release, and have existing case creation rules for email and social activity:

Existing rules prior to upgrade What happens to the rules after upgrade?
A rule that has rule items with conditions and properties defined ·    The rule and rule items are upgraded and the properties and conditions in the existing rule items are preserved.·    A new rule item is created with blank conditions. A new Create Record step (with Case selected) is added with out-of-the-box property mapping. The rule items are applied in an order and the newly-created rule item is considered last in the order.
A rule that has a rule items with conditions , but no properties defined ·    The rule and rule items are upgraded and the conditions in rule items are preserved.·    A new rule item is created with blank conditions. A new Create Record step (with Case selected) is added with out-of-the-box property mapping. The rule items are applied in an order and the newly-created rule item is considered last in the order.
A rule that has a rule items with no conditions or properties defined ·    The rule and rule items are upgraded.·    A new rule item is created with blank conditions. A new Create Record step (with Case selected) is added with out-of-the-box property mapping. The rule items are applied in an order and the newly-created rule item is considered last in the order.
A rule that has a rule items with properties, but no conditions defined ·    The rule and rule items are upgraded and the properties in the rule items are preserved.·    A new rule item is created with blank conditions. A new Create Record step (with Case selected) is added with out-of-the-box property mapping. The rule items are applied in an order and the newly-created rule item is considered last in the order.
A rule with no rule items ·    The rule is upgraded.·    A new rule item is created with blank conditions. A new Create Record step (with Case selected) is added with out-of-the-box property mapping. The rule items are applied in an order and the newly-created rule item is considered last in the order.
An active case creation rule for social or email source types, with a queue specified All such rules will be upgraded in an active state.
An active case creation rule for social or email source types, without a queue specified All such rules will be upgraded and deactivated. This is because even in Microsoft Dynamics CRM Online Spring ‘14, a case creation rule without a queue did not apply and create any record.

See Also

Create rules to automatically route cases

Create or edit a queue