Skip to main content

Notifications

Import contacts from excel to create segments in RTM

Introduction

Dynamics Customer Insights provides a rich segmentation capabilities that allow customers to find the right people to target in a given journey. However, there are situations in which the list of customers to target is provided externally. This could happen, for example, following a physical event in which the list of customers to contact is captured manually.

Today, Customer Insights Real Time Marketing only supports segments based on queries or manually adding individual contacts. However, with a simple configuration, standard capabilities in Model-Driven Apps can be leveraged to provide a solution to work with an externally provided file.

Solution Approach

The proposed approach is to:
  • Create 2 custom tables in Dataverse which will hold the name of the list to be sent and the members of the list
  • Create a record for the list to be imported
  • Create a segment in real-time marketing that will dynamically read the content of those tables to provide a segment for each list
  • Import the segment members using Dataverse’s import from Excel capabilities (see Import data from Excel and export data to CSV - Power Apps | Microsoft Learn)
With the above approach, customers will be able to import a list and also manage the members (add, remove) as needed.
In this approach, we are assuming that all the individuals to be added to the list already exist as contacts within Customer Insights Journeys. If the contact does not exist, the process will ignore that individual from the segment.  

Detailed Approach

Create Tables

As a first step, we create 2 custom tables in the Power Apps maker portal (https://make.powerapps.com/). For more information, see Create a custom table that has components with Power Apps - Power Apps | Microsoft Learn.

The first table is named in this example “One-off send”. The table will hold the name of the lists to be imported. A different name more appropriate for your use case can be used. When creating the table, it is important to set the property “Track Changes” to ON, as this is required for tables to be used in Customer Insights segmentation. The second table created is “One-off Send Member”. This table will become the intersection table between Contacts and One-off Send lists. In this table, the property “Track Changes must also be turned ON.

Next, we create two Many to one relationships for the “One-Off Send Members” table between this table and "Contact" and this table and “One-Off Sends”.

Once the tables are ready, we add them to the Dynamics Customer Insights – Journeys app to allow users to navigate and work with them (see Work with pages in model-driven apps - Power Apps | Microsoft Learn).

Create list data

Once the tables are created and available in the app, the next step is to import the data. For this we create a new “One-Off Send” in the Customer Insights – Journeys app.

Create segment

With that record created, we create a Customer Insights Journeys segment which will be the one used in the communication journeys. This segment will be a dynamic query retrieving the contacts which are one-off send members of the one-off send list we just created.



As this is the first time we are using the newly created tables, it is necessary to add the tables to the segment editor by clicking the “+ Add table” link and selecting both tables.



Adding the tables will start a synching process to bring the table structures into the segmentation engine but we can continue and add the criteria needed. In our scenario, what we will add is the “One Off Send” column of the “One-Off Send table.



Then we select the relationship path needed. In our scenario, there is only path available from the newly created table to the Contact table so we select that.



We then select the fields that hold the relationships in the selected path.



Then we can select the One-Off Send list we want our segment to based on.


Import Excel with One-off send members

Using standard features of Dataverse, we now import the list of members we want to email to (see Import data in model-driven apps - Power Apps | Microsoft Learn). First, we will use advanced filters to search for the table “One-Off Send Members”. From the Search box, we click on “Search for rows in a table using advanced filters.



We then select the One-Off Send Members table.



And accept the default filters.



From the view of Active One-Off Send Members, we can download an Excel template that will be used when importing data to this table.

In the download template dialog, we select the entity and view we want. We can select the necessary columns using Edit Columns. At a minimum, we will need the Contact and One-Off Send fields.


In the downloaded Excel template, we can add the necessary data for import.



It is recommended that only new rows are added to the downloaded template. The downloaded template may contain existing records which would be updated.

Note that the data in the One-Off Send column must match the name of an existing record in One-Off end table. Equally, in the Contact table, we must use a value that can help us identify the relevant contact. In the example above, the email address is used as that identifier.

Back in Customer Insights Journeys, we use the “Import from Excel” button to start the import.



We then select the file to import



And then select the option to review the mapping. In the mapping screen, we select the email as a column to be used as the lookup reference for the contact.



And then finish the import.



Once the import is complete, each row in the Excel will be added as a new record in the One-Off Send Members table.



By the benefit of adding the records here, the segment will be able to evaluate the created query and add the contacts that were present in the import file. Should it be necessary, additional records can be added to the One-Off Send Members table to add more contacts to the segment. Equally, deleting One-Off Send Member records will remove from the contact from the segment.

Further enhancements

In the above solution, we are using a segment based on a query that will refresh constantly. This works well when multiple files are to be imported as we keep adding “One-off Send Members” at different times (even manually) and the segment will change.

However, in some scenarios it may be desired to mirror a given imported file and have no further additions. In those cases, once the import is complete and the segment has been evaluated, the segment could be turned into a snapshot segment (Create a static snapshot of a segment - Dynamics 365 Customer Insights | Microsoft Learn).
​​​​​​​

Comments