Create a Custom Channel in Dynamics 365 Customer Insights

  

How to Create a Custom Channel in Dynamics 365 Customer Insights - Journeys – Complete Step-by-Step Guide

Introduction

Dynamics 365 Customer Insights - Journeys provides built-in communication channels such as Email, SMS, and Push Notifications. However, businesses often need to communicate with customers through additional platforms such as WhatsApp, third-party SMS gateways, custom notification providers, or their own communication services.

What happens when the communication provider you want to use isn't available as a native channel?

This is where Custom Channels in Dynamics 365 Customer Insights - Journeys become useful.

Custom Channels allow us to integrate external communication providers with Customer Insights - Journeys. We can define our own channel, configure its connection details, design message fields, and implement custom plugin logic to send messages through an external provider.

In this article, we'll walk through the complete process of creating a custom channel manually, starting from the Microsoft sample solution package and progressing through channel configuration, message creation, Custom API development, and journey integration.

By the end, we'll have a reusable custom channel that can support multiple message templates and can be used in Customer Insights - Journeys.

1. Understand the Custom Channel Architecture

Before starting the implementation, let's understand the main components involved in creating a custom channel.

A custom channel consists of several components that work together.

ComponentPurpose
Custom Channel PackageContains the Dataverse solution components and plugin implementation
Channel InstanceRepresents a configured sender or connection to the external provider
Channel DefinitionDefines the custom channel and connects its configuration and APIs
Channel Message PartDefines the fields available when creating a message
Custom Channel MessageStores the actual message content and configuration
Custom Message EditorProvides a customized interface for creating messages (optional)
Custom APIProvides the entry point for executing outbound plugin logic
PluginProcesses the message payload and communicates with the external provider

The overall flow looks like this:

  1. Create and customize the custom channel solution package.

  2. Import the solution into Dataverse.

  3. Configure the extended Channel Instance entity.

  4. Define the Channel Message Parts.

  5. Define the Channel Definition.

  6. Configure the outbound Custom API.

  7. Create a Channel Instance in Customer Insights - Journeys.

  8. Create custom channel messages with the required fields.

  9. Process the message through the plugin.

  10. Use the message in a customer journey.

The important thing to understand is that the Channel Definition describes the channel, whereas the Channel Instance represents a configured sender or connection.

For example, if we create a WhatsApp custom channel, the channel definition represents WhatsApp as a communication channel. A channel instance represents a particular WhatsApp sender or provider connection.

The channel can then be used to create and manage multiple message templates.

2. Download and Prepare the Custom Channel Package

The first step is to obtain Microsoft's sample custom channel solution.

Microsoft provides sample solutions containing the Dataverse solution structure and plugin projects required to implement a custom channel.

Official documentation:

https://learn.microsoft.com/en-us/dynamics365/customer-insights/journeys/real-time-marketing-extend-outreach-custom-channels

Look for the SampleCustomChannel.zip package under the Sample solutions section.

2.1 Extract the Package

Download the SampleCustomChannel.zip file and extract it to your development machine.

The sample contains the solution project and plugin implementation.

Instead of directly importing the sample package, we'll customize it according to our own implementation requirements.

For example, we may want to change:

  • Publisher prefix.

  • Solution name.

  • Custom table names.

  • Custom table logical names.

  • Custom API names.

  • Plugin class names.

  • Message fields.

  • Channel display name and configuration.

2.2 Update the Solution Publisher Prefix

The Microsoft sample uses its own publisher prefix.

For this implementation, let's assume our publisher prefix is:

contoso

We want our custom components to follow a consistent naming convention.

For example:

ComponentExample logical name
Channel Instance Extended Entitycontoso_customchannelinstance
Message Configuration Entitycontoso_customchannelmessage
Message Text Fieldcontoso_text
Placeholders Fieldcontoso_placeholders

Replace the sample publisher prefix with your own prefix wherever the sample references custom component names.

Important: Don't blindly replace every occurrence of the existing prefix in all files. Check the component type and references before modifying them.

Microsoft's existing platform components, such as msdyn_channeldefinition, msdyn_channelmessagepart, and msdyn_channelinstance, must retain their original names.

Only rename components that belong to your custom solution.

2.3 Update Custom Table Names

If you change the custom table names, update all references to those tables.

Pay particular attention to:

  • Entity logical names.

  • Relationship definitions.

  • Form definitions.

  • Channel definition metadata.

  • Plugin references.

  • Custom API configuration.

  • Solution component references.

The Channel Instance extended configuration entity must also follow Microsoft's naming requirements.

One important requirement is that its logical name must use lower camel case.

2.4 Rebuild and Package the Solution

After updating the solution:

  1. Open the plugin project in Visual Studio.

  2. Update the necessary namespaces and class references.

  3. Build the plugin project.

  4. Verify that the generated DLL is copied into the solution's PluginAssemblies folder.

  5. Package the unmanaged solution using Power Platform CLI.

Microsoft recommends using Solution Packager to package the solution.

Example command:

pac solution pack --zipfile C:\Temp\CustomChannelSolution.zip -f C:\Source\CustomChannel\unmanaged --packagetype Both

The generated ZIP file is now ready to be imported into your Dataverse environment.

Tip: Maintain separate development and deployment packages, and verify that the final solution contains the plugin assembly and all required metadata components.

3. Create the Extended Configuration Entity for Channel Instance

After importing the custom channel solution, the next step is to configure the Channel Instance.

A Channel Instance represents a particular sender or provider connection.

For example, if we integrate a WhatsApp provider, the instance might contain:

  • Provider API URL.

  • API key.

  • Sender ID.

  • Account ID.

  • Authentication information.

  • Other provider-specific settings.

These configuration values should not be hardcoded in the plugin.

Instead, we'll create a custom Dataverse table to store the extended configuration.

3.1 Create a Custom Dataverse Table

Create a new table in your solution.

Example:

Table display name: Custom Channel Instance

Logical name: contoso_customchannelinstance

Add the configuration columns required by your provider.

Example:

ColumnData typePurpose
contoso_apiurlTextProvider API endpoint
contoso_apikeyTextAPI authentication key
contoso_senderidTextSender identification
contoso_accountidTextProvider account identifier

These are example fields. Your actual configuration depends on the external communication provider.

3.2 Create the Relationship with Channel Instance

Creating the custom table alone is not sufficient.

We must establish the relationship between our extended configuration entity and the base Dataverse table:

msdyn_channelinstance

The relationship uses the base table's msdyn_extendedentityid attribute, which is a polymorphic lookup.

Microsoft documents a specific relationship configuration for this implementation.

Important: Microsoft explicitly warns that the relationship generated by the XRMToolBox Polymorphic Lookup Creator does not work for this scenario.

Instead, follow the relationship XML approach documented by Microsoft.

The required steps are:

  1. Create the relationship XML using the correct custom table logical name.

  2. Add the XML file under the unpacked solution's Other\Relationships folder.

  3. Create a file with the same name as the custom table.

  4. Add the relationship name to Other\Relationships.xml.

  5. Repackage the solution.

This relationship is essential because Customer Insights - Journeys needs to associate the custom configuration record with the corresponding Channel Instance.

3.3 Create the Configuration Form

Create a main form for the extended configuration table.

Add the configuration fields that an administrator needs to enter when creating a channel instance.

For example:

  • API URL

  • API Key

  • Sender ID

  • Account ID

This form will be displayed as part of the custom channel configuration experience.

3.4 Assign Required Security Privileges

There is another important configuration requirement.

Customer Insights - Journeys accesses the extended configuration entity during message submission.

Therefore, grant Read privileges for your extended configuration entity to the security role:

Cxp Channel Definitions Services User

Without the necessary privileges, the channel may fail when the platform attempts to access its configuration.

4. Create Channel Message Parts

Now that the channel instance configuration is ready, let's define the fields that users will see when creating custom channel messages.

This is where Channel Message Parts come into the picture.

A Channel Message Part defines the structure of a message.

For example, if we want to send a WhatsApp message, our message might contain:

  • Message Text

  • Template Name

  • Language

  • Image

  • Customer Reference

Each of these can be represented through a message part, depending on the supported message contract.

The message parts are stored in the standard Dataverse table:

msdyn_channelmessagepart

4.1 Supported Message Part Types

Microsoft provides several message part types.

TypeValueDescription
Plaintext192350000Simple text
Media192350003File ID from msdyncrm_file
Image192350004Image ID from msdyncrm_file
Record192350005Record ID from an external entity
Number192350006Number represented as a string
Boolean192350007True or false
Options192350008Selection from predefined options
Date192350009Date without time
Datetime192350010Date and time

For example, let's create the following message parts:

NameDisplay NameTypeRequired
textMessage TextPlaintextYes
templateTemplate NamePlaintextYes
languageLanguagePlaintextNo
customerCustomer ReferenceRecordNo

The customer field is an example of a record-type message part.

For record-type parts, we can configure the associated entity and view using:

  • msdyn_entityname

  • msdyn_entityviewid

4.2 How Are Message Parts Created?

Message parts are defined as solution-aware components in the solution's customizations.xml file.

They are placed under:

ImportExportXml > msdyn_channelmessageparts

Each message part needs:

  • A unique GUID.

  • A channel definition ID.

  • A name.

  • A display name.

  • A description.

  • A message part type.

  • A required/optional setting.

  • An optional maximum length and order.

The msdyn_name attribute is especially important.

It acts as the key used to map message part information to the outbound message content.

For example, if the message part name is text, the outbound payload will contain a corresponding text key in its Message dictionary.

Important: Every custom channel must have at least one message part.

5. Create the Channel Definition

Now we have the extended configuration entity and message parts.

The next step is to connect everything through the Channel Definition.

The standard Dataverse table is:

msdyn_channeldefinition

The Channel Definition describes our custom communication channel and connects its configuration entity, outbound API, and message parts.

Some important attributes include:

AttributePurpose
msdyn_displaynameChannel display name
msdyn_descriptionChannel description
msdyn_channeltypeCustom or SMS
msdyn_outboundendpointurltemplateOutbound Custom API name
msdyn_hasinboundIndicates inbound support
msdyn_hasdeliveryreceiptIndicates delivery receipt support
msdyn_supportsaccountIndicates account-level configuration support
msdyn_channeldefinitionexternalentityExtended configuration entity logical name
msdyn_channeldefinitionexternalformidConfiguration form ID
msdyn_messageformidOptional custom message editor form ID

5.1 Configure the Channel Definition

Let's assume we are creating a custom notification channel.

Our Channel Definition should contain:

  • Display name: Custom Notification

  • Channel type: Custom

  • Outbound API: Our custom outbound API

  • Extended entity: contoso_customchannelinstance

  • External form ID: The form ID of our configuration form

  • Inbound support: No, if not implemented

  • Delivery receipt: Based on provider capabilities

The Channel Definition is also connected to the message parts using the Channel Definition ID.

5.2 Important Considerations

The Channel Definition is not something we create separately for every message.

It represents the channel itself.

For example, we can create one WhatsApp Channel Definition and use it to create multiple WhatsApp message templates.

This makes the implementation reusable and easier to maintain.

6. Create the Outbound Custom API

The outbound Custom API is one of the most important parts of the implementation.

It is the entry point that Customer Insights - Journeys calls when it needs to submit a message.

The Custom API connects the Customer Insights - Journeys runtime with our custom plugin logic.

Microsoft requires the outbound Custom API to implement a specific request and response contract.

6.1 Create the Custom API

Create an outbound Custom API in Dataverse.

Configure the plugin type and the request/response parameters according to Microsoft's documented contract.

The outbound Custom API should accept one input parameter:

payload

And return one output parameter:

response

The API name must match the name configured in the Channel Definition's msdyn_outboundendpointurltemplate attribute.

6.2 Understand the Incoming Payload

The incoming payload is serialized JSON.

It contains the following information:

PropertyDescription
ChannelDefinitionIdChannel Definition GUID
RequestIdUnique request ID
IdempotencyIdIdempotency identifier
FromSender or Channel Instance
ToRecipient
MessageDictionary containing message parts
MarketingAppContextJourney execution context

The most important property for our implementation is Message.

For example, the message dictionary could contain:

{
  "text": "Hello, your order has been shipped!",
  "template": "order_shipped",
  "language": "en"
}

This means our plugin can access the values using the message part names defined earlier.

For example:

  • text

  • template

  • language

The names must match the message part names configured in the Channel Message Part entity.

6.3 How Do Custom Message Fields Reach the Plugin?

This is an important concept.

When we create a custom channel message, Customer Insights - Journeys uses the message parts defined in the Channel Definition to structure the message.

The values entered in the message editor are included in the outbound Custom API payload.

The plugin receives these values inside the Message dictionary.

For example, if we define a message part named text, the plugin can retrieve it from the dictionary using that key.

Similarly, if we define a record-type message part named customer, the corresponding record identifier is passed as a string value.

This allows us to pass different types of message configuration data to the plugin without creating a separate Custom API parameter for every message field.

Important: The outbound API contract represents message parts as a Dictionary<string, string>. Therefore, even record identifiers and numeric values are handled as string values in the message payload.

7. Develop the Plugin to Process the Message

Once the Custom API is configured, we can implement the plugin logic.

The plugin receives the payload, reads the message information, retrieves the Channel Instance configuration, and calls the external communication provider.

The basic processing flow is:

  1. Receive the Custom API request.

  2. Read the payload.

  3. Deserialize the JSON.

  4. Retrieve the Channel Definition ID.

  5. Read the sender and recipient.

  6. Read the Message dictionary.

  7. Retrieve the corresponding Channel Instance configuration.

  8. Call the external provider API.

  9. Process the provider response.

  10. Return the response in the required format.

7.1 Example Message Processing

Suppose we receive this message:

{
  "From": "WhatsAppSender01",
  "To": "+911234567890",
  "Message": {
    "text": "Your appointment is confirmed.",
    "template": "appointment_confirmation",
    "language": "en"
  }
}

Our plugin can read the message values using their respective keys.

Conceptually:

string messageText = message["text"];
string templateName = message["template"];
string language = message["language"];

The plugin can then use these values to prepare the request for the external provider.

The actual implementation should also include validation, exception handling, authentication, logging, and appropriate response handling.

7.2 Retrieve Channel Instance Configuration

The provider configuration should be retrieved from the extended Channel Instance entity.

For example, the plugin may need:

  • API endpoint

  • Authentication key

  • Sender ID

These values allow the plugin to communicate with the correct provider account.

Remember that the Channel Instance represents the sender configuration, while the Channel Definition represents the channel itself.

7.3 Return the Required Response

After processing the provider request, the plugin must return a response using the documented Custom API contract.

The response contains:

  • ChannelDefinitionId

  • MessageId (optional)

  • RequestId

  • Status

  • Details (optional)

The supported submission statuses are:

StatusMeaning
SentProvider accepted the submission
NotSentSubmission was rejected and cannot be retried

One important consideration is that the custom channel execution has a maximum timeout of 20 seconds.

Therefore, keep the plugin execution efficient and avoid long-running operations.

8. Create the Custom Channel Instance

Once the solution is imported and configured, we can create the actual Channel Instance.

Open Dynamics 365 Customer Insights - Journeys.

Navigate to:

Settings → Custom channels

Then follow these steps:

  1. Select + New channel.

  2. Select the custom channel app that we installed.

  3. Enter the required connection details.

  4. Configure the sender information.

  5. Review the configuration.

  6. Complete the setup.

The extended configuration form created earlier will be used to capture the provider-specific settings.

For example, we can configure:

FieldExample
API URLProvider endpoint
API KeyProvider authentication key
Sender IDWhatsApp sender
Account IDProvider account

After completing the configuration, we have a Channel Instance ready for use.

Important: A Channel Instance represents one configured sender. If the same channel needs multiple senders or provider connections, we can configure separate instances.

9. Create Custom Channel Messages

Now comes the most interesting part.

After creating the custom channel and its instance, we can create messages that will be used in customer journeys.

Navigate to:

Customer Insights - Journeys → Channels → More channels

Then:

  1. Select + New message.

  2. Select the custom channel.

  3. Use the message editor to enter the message content.

  4. Configure the available fields.

  5. Save the message as a draft or select Ready to Send.

The message editor uses the message parts we defined earlier.

For example, our custom channel message may have the following fields:

FieldExample value
Message TextYour appointment is confirmed
Template Nameappointment_confirmation
LanguageEnglish
Customer ReferenceSelected customer record

When this message is submitted, the values are made available to our outbound Custom API through the message dictionary.

9.1 Create Multiple Messages for the Same Channel

One of the major benefits of custom channels is reusability.

We don't need to create a separate Channel Definition or Custom API for every message template.

For example, the same custom channel can support:

  • Order Confirmation

  • Order Shipped

  • Payment Reminder

  • Appointment Confirmation

  • Promotional Notification

Each message can contain different content while using the same channel infrastructure.

This keeps the solution modular and reduces duplicate development.

10. Use the Custom Channel in a Customer Journey

After creating and saving the custom channel message, we can use it in a customer journey.

Open Customer Insights - Journeys and create a new journey or edit an existing one.

On the journey canvas:

  1. Select the + button.

  2. Choose Send other types of messages.

  3. Select the custom channel.

  4. Select the relevant message.

  5. Configure the remaining journey settings.

  6. Validate and publish the journey.

When the journey reaches this action, Customer Insights - Journeys invokes the outbound Custom API.

Our plugin receives the message payload and processes the communication request.

This completes the end-to-end integration.

11. Important Implementation Considerations

Before deploying the custom channel to production, consider the following points.

11.1 Publisher Prefix Consistency

Use a consistent publisher prefix across all custom tables, columns, relationships, and components.

If the prefix or table names are changed in the sample package, make sure all references are updated.

11.2 Message Part Names Must Match

The message part name is used as the key in the outbound message dictionary.

For example, if the message part name is text, the plugin must retrieve text, not messageText.

11.3 Record-Type Message Parts

If a message part uses the Record type, configure the entity and view metadata correctly.

The record identifier is passed through the message contract as a string.

Don't assume that the outbound message dictionary will contain a fully populated Dataverse record.

11.4 Custom Message Editor Is Optional

A custom message editor is not mandatory.

Customer Insights - Journeys provides a generic editor for custom channels.

If the generic editor satisfies your requirements, there is no need to develop a separate editor.

A custom editor is useful when you need a specialized user experience or additional controls.

11.5 Secure Provider Credentials

Avoid exposing provider credentials in message templates.

Store provider configuration in the appropriate Channel Instance configuration and apply suitable Dataverse security.

11.6 Plugin Performance

The outbound Custom API has a maximum execution timeout of 20 seconds.

Make sure the plugin completes within this limit.

Implement appropriate error handling and ensure that retry scenarios do not unintentionally send duplicate messages.

11.7 Delivery Receipts

If the external provider supports delivery notifications, consider implementing a delivery report Custom API.

The provider can send delivery updates through your integration, and the implementation can call the platform's msdyn_D365ChannelsNotification API.

This allows delivery information to be reflected in Customer Insights - Journeys analytics.

Download CRM 365 V9.X Tools using PowerShell

This configuration explains about how to download D365 utility tools step by steps.

Step1 : Create a folder in your particular drive where you want to download the tools.
Step2 : Open the Power Shell Run, in power shell console, move or change the directory folder to particular folder.








Step3 : Copy and paste the below scripts in that folder directory and press enter.



$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$targetNugetExe = ".\nuget.exe"
Remove-Item .\Tools -Force -Recurse -ErrorAction Ignore
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
Set-Alias nuget $targetNugetExe -Scope Global -Verbose
##
##Download Plugin Registration Tool
##
./nuget install Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool -O .\Tools
md .\Tools\PluginRegistration
$prtFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool.'}
move .\Tools\$prtFolder\tools\*.* .\Tools\PluginRegistration
Remove-Item .\Tools\$prtFolder -Force -Recurse
##
##Download CoreTools
##
./nuget install Microsoft.CrmSdk.CoreTools -O .\Tools
md .\Tools\CoreTools
$coreToolsFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.CoreTools.'}
move .\Tools\$coreToolsFolder\content\bin\coretools\*.* .\Tools\CoreTools
Remove-Item .\Tools\$coreToolsFolder -Force -Recurse
##
##Download Configuration Migration
##
./nuget install Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf -O .\Tools
md .\Tools\ConfigurationMigration
$configMigFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf.'}
move .\Tools\$configMigFolder\tools\*.* .\Tools\ConfigurationMigration
Remove-Item .\Tools\$configMigFolder -Force -Recurse
##
##Download Package Deployer
##
./nuget install Microsoft.CrmSdk.XrmTooling.PackageDeployment.WPF -O .\Tools
md .\Tools\PackageDeployment
$pdFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.PackageDeployment.Wpf.'}
move .\Tools\$pdFolder\tools\*.* .\Tools\PackageDeployment
Remove-Item .\Tools\$pdFolder -Force -Recurse
##
##Remove NuGet.exe
##
Remove-Item nuget.exe



Step 4 : Once script will be completed then you can see in the folder, new tools folder are created.



Featured Posts

Create a Custom Channel in Dynamics 365 Customer Insights

   How to Create a Custom Channel in Dynamics 365 Customer Insights - Journeys – Complete Step-by-Step Guide Introduction Dynamics 365 Custo...

Popular Posts

Contact Me

Name

Email *

Message *