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”.
- Select Common Data Service (current environment)
- Select When a record is created, updated or deleted trigger
- 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
- 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
- Add a Control condition and set the following attributes:
- 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)
- Add a List Records common data service action and set it up with the following attributes:
- 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
- Within the Apply to Each action add a Perform a bound action from the Common Data Service:
That’s it, I hope this post has saved you some time. Feel free to leave a comment below if you have any questions.
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
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
Thanks for the update Alan.
Great article and thank you for the help.