web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Creating dynamic expression for Marketing Email's "To address" field

(0) ShareShare
ReportReport
Posted on by 5

Hello everyone,

In my Dynamics 365 for Marketing contacts, I have contacts who have email addresses in the fields emailaddress1, emailaddress2 and emailaddress3. I have created a marketing email that I want to send to contacts in a segment comprising contacts with emails in any of these fields.

Is there a way for me to write a dynamic expression in the "To address" in the marketing email such that for each contact, the system checks for a valid email address in emailaddress1 field, then emailaddress2, then emailaddress3 fields? The first field where valid data is found should be selected and the marketing email should be sent to that address.

Best regards

I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,060 on at

    Hi,

    Would you please explain your definition of Valid?

    Due to the type of the email field, if the input value is an invalid email, it cannot be saved.

     pastedimage1627871457233v1.png

    If there are other rules for the format, the request cannot be achieved by dynamic expression.

    It is recommended to create an on-demand workflow targeting at Contact entity, which checks the email addresses one by one and sets the value to emailaddress1 if you find a valid one.

    Then insert the workflow into the customer journey to process the contacts who are going to be sent the email. So that you don’t need to modify the dynamic expression of the Marketing Email's "To address" field.

    pastedimage1627871466319v2.png

  • Fola Lana Profile Picture
    5 on at

    Thank you for your response Nya.

    Pardon my use of the term "valid" in the initial question. It is not relevant for this issue since all email addresses in these fields are valid as you rightly stated. The main challenge is about how to get the email sent to the email addresses in emailaddress2 and emailaddress3 since the system sends emails to emailaddress1 by default.

  • Verified answer
    Nya Profile Picture
    29,060 on at

    Hi,

    Assuming that some of the Email Address fields are empty, we can use the following workflow to handle these fields.

    1. Create an on-demand workflow.

     pastedimage1627887774057v1.png

    1. If Email does not contain data and Email Address 2 contains data, then set the value of Email Address 2 as the value of Email.

     pastedimage1627887783572v2.png

    1. If Email and Email Address 2 do not contain data, and Email Address 3 contains data, then set the value of Email Address 3 as the value of Email.

     pastedimage1627887790415v3.png

    The workflow allows to ensure that the emailaddress1 always has a value if one of the addresses contains data.

  • Fola Lana Profile Picture
    5 on at

    Thank you for your response Nya.

    A bit more context to help. The reason some contacts have email addresses in emailaddress2 and emailaddress3 fields is because some teams do not want the email addresses of their contacts visible to everyone else using the CRM. The configured views and forms for contacts only show emailaddress1. However, when segments are created for marketing emails, some of these contacts without email addresses in emailaddress1 field are included in these segments and the goal is to have the marketing email delivered to them as well.

    So, I am looking for a temporary solution that ensures the marketing email targets not only the emailaddress1 field, but also emailaddress2 and emailaddress3. I do not want to permanently write values to the emailaddress1 field if no email address was written in there initially.

    Am I right in understanding that the approach of creating an on-demand workflow will permanently copy the email address in emailaddress2 or emailaddress3 to the emailaddress1 field?

    Regards,

    Fola

  • Verified answer
    Nya Profile Picture
    29,060 on at

    Hi Fola,

    Yes, it will permanently copy the email address in emailaddress2 or emailaddress3 to the emailaddress1 field with my solution.

    Then how about copy the valid email address to emailaddress2 or 3 or a custom email field, which can be set as invisible to others?

    It can be achieved in a similar way.

    You just need to adjust the conditions and steps in the workflow and set the dynamic expression as something like {{ contact.emailaddress2 }} , {{ contact.emailaddress3 }} or {{ contact.the name of the custom field }}.

  • slx Profile Picture
    386 on at

    Why field {{contact.emailaddress1}} cannot be updated?

    "To address: This should almost always be set to {{ contact.emailaddress1 }}, which sends the message to each contact included in the customer journey that sends the email. You might change this to use a different email address field (such as emailaddress2), or enter a dynamic expression that chooses the best of several available email fields."

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 168 Super User 2026 Season 1

#2
NeerajPawar Profile Picture

NeerajPawar 65

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 51 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans