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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dynamics 365 unsubscri...
Power Automate
Answered

Dynamics 365 unsubscribe flow

(0) ShareShare
ReportReport
Posted on by 113

Hi all,

 

In Dynamics 365 Sales, I need to update Contact fields 'GDPR Optout' and 'Bulk Email' when receiving an email on Outlook 365.

Do you have any suggestions on how to setup the Dynamics 365 part of the flow?

Categories:
I have the same question (0)
  • alex_mcla Profile Picture
    92 on at

    You'll need a Dataverse Update a row step for the Contacts table.

     

    You'll then be able to set the values in the step, for GDPR:

     

    GDPR OptoutGDPR Optout

     

     

     

     

     

     

     

     

    I'm assuming the email will be tracked in Dynamics.

     

    So the trigger would be on a new Email row. 

     

     

  • ThimiosSp Profile Picture
    113 on at

    Thank you @alex_mcla .

    1. What should the input be in Row ID field?

    1.png

    2. I can't seem to find a GDPR Output field in my list? Why is that?

    2.png

  • alex_mcla Profile Picture
    92 on at

    @ThimiosSp I was assuming that the trigger would be on the Dataverse Email table and you could then use the From field.

     

    If the email isn't tracked into Dataverse, you'll need:

    1. An additional Dataverse step to List the Contacts with the email address
    2. Optionally, a Compose to get the first value (see Tip of the Day post) - this can be included in the update as a formula to save a step, but is more complex
    3. The update as you've tried, using the contactid from the compose

    On your question about the GDPR field, flow puts the columns from the first tab of the Dynamics form at the top and all the other below, so it might be lower down in the list. Otherwise, let me know.

  • ThimiosSp Profile Picture
    113 on at

    Thank you @alex_mcla but my skills won't take me that far :))

    I can't get List Rows from Contacts table in Dataverse filtered (Filter Rows) by the email of sender.

    Will probably have to find a pro to get this done for me.

  • Verified answer
    alex_mcla Profile Picture
    92 on at

    Hi @ThimiosSp 

     

    Try the following:

    Screenshot_20221120_163547.png

    You have the first step.

     

    The List row is:

    Screenshot_20221120_143826.png

    The FetchXML is

    <fetch top="10">
     <entity name="contact">
     <attribute name="contactid" />
     <attribute name="emailaddress1" />
     <filter>
     <condition attribute="emailaddress1" operator="eq" value="" />
     </filter>
     </entity>
    </fetch>

    Your then insert the From field.

     

    The list returns the list of Contacts matching the From field. You'll need to decide what to do if you have duplicates, I've assumed you'd only update the first returned.

     

    The condition is

    Screenshot_20221120_164252.png

    The expression is: length(outputs('List_rows')?['body/value']). The Terminate stops the flow if there isn't a match.

     

    The compose gets the first Contact Id

    Screenshot_20221120_143918.png

    first(outputs('List_rows')?['body/value'])?['contactid']
     
    The Update a row is then
    Screenshot_20221120_164625.png

     

    I have a basic version of Dynamics/Dataverse and there isn't a GDPR field in that either. I suggest you add a new field and you'll be able to set it in the update flow step.

     

    If this works for you, please could you mark is as the solution to your question.

  • ThimiosSp Profile Picture
    113 on at

    Thank you @alex_mcla for spending so much time on this.

    It looks like though that 'List Rows' produces no output (I run several tests with a demo D365 contact).

    ThimiosSp_0-1669041437548.png

    Any thoughts?

     

  • alex_mcla Profile Picture
    92 on at

    Hi @ThimiosSp

     

    Are you sure there's a Contact with that exact email in Dynamics? 

     

    Is the List rows output empty?

  • ThimiosSp Profile Picture
    113 on at

    Hi @alex_mcla 

    This is a Contact created with my personal email account under an existing Account, so yes.

    List rows is empty.

    I will run a couple more tests during the weekend and let you know.

  • ThimiosSp Profile Picture
    113 on at

    Hi @alex_mcla 

    Flow run unsuccessfully today, here is the overall picture and the output results.

    Could you pls take a look?

    ThimiosSp_1-1669877760781.png

     

  • alex_mcla Profile Picture
    92 on at

    Hi @ThimiosSp 

     

    Checking that the FetchXML in your List rows looks like

     

    FetchXMLFetchXML 

     

    (The triggerOutputs()?['body/from'] is from hovering over the From.)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard