How to Add to a Member to a Microsoft Dynamics 365 Marketing List using Power Automate


I recently had a scenario where I needed to add a new member to an existing Microsoft Dynamics 365 static marketing list using Microsoft Power Automate and in this post I’ll break it down step by step to show how I did it.

Overview

For this example create a new Marketing List within Dynamics 365 with the following attributes:

  • Type: Static
  • Targeted At: Contact

In the example below I’ve called the marketing list ‘Test Contact List’ and I’ll add a contact to it if the city equals Syndey.

Note: I know that a Dynamic Marketing list would be best in this situation, however sometimes a static list is required for a 3rd party Marketing Addon to work.

Power Automate Example: Adding a new List Member

The flow below uses Common Data Service (current environment) connector, the easiest way to create it is to create a new solution at https://make.powerapps.com/ then select “New | Flow”.

  1. Select Common Data Service (current environment)
  2. Select When a record is created, updated or deleted trigger
  1. Set up the trigger to fire on a create or update of a contact record, and to fire the flow for all users (i.e. organization scope):
    • Trigger condition: Create or Update
    • The entity name: Contacts
    • Scope: Organization
    • Filtering attributes (under advanced options): address1_city
  1. Next check to see if the city is equal to “Sydney”
    • Add a Control condition and set the following attributes:
      • Value = Address1: City (from the trigger)
      • Condition = is equal to
      • Value = Sydney
  1. If the check is true (Yes) then we’ll get the ID of the Dynamics Marketing List we are going to add the contact to:
    • Add a List Records common data service action and set it up with the following attributes:
      • Entity Name: Marketing Lists
      • Select Query: listid
      • Filter Query: listname eq ‘Test Contact List’
      • Top Count: 1
      • Rename to Get Marketing List
    • Add a Apply to each control:
      • Output value: value (from Get Marketing List)
  1. Now we have the Contact ID and the Marketing List ID we can add them to the Dynamics 365 Marketing List:
    • Within the Apply to Each action add a Perform a bound action from the Common Data Service:
      • Entity Name: Marketing Lists
      • Action Name: AddMemberList
      • Item ID: items(‘Apply_to_each’)?[‘listid’]
        • This is the Marketing List ID, add this as an expression
      • Entity ID: Contact
        • The contact ID from the initial trigger
    • Rename the action to Add to Marketing List

That’s it, I hope this post has saved you some time. Feel free to leave a comment below if you have any questions.

4 thoughts on “How to Add to a Member to a Microsoft Dynamics 365 Marketing List using Power Automate

  1. Hi,
    thank you for this instructions. I am so happy that all is allready ok. Maybe you can write that now is not Common Data Service but just Micosoft Dataverse.

    Michaela

  2. I found that the answer to this has now changed. The new answer is “Perform a bound action”, as here: https://stackoverflow.com/questions/69846430/add-member-to-marketing-list-in-power-automate-with-microsoft-dataverse

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts