Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

How to update Related column of email entity using power automate flow

(3) ShareShare
ReportReport
Posted on by
Hi,
 
I need to set/update related column of email entity to contacts and accounts using power automate flow. Can’t find much documentation to advise how this can be achieved via flow.
 
below site is having details of how this is done manually
 
 
but need to understand how we can set using power automate flow
 
thank you 
 
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    Super User 2025 Season 1 on at
    How to update Related column of email entity using power automate flow
    Hello RK-07031115-0,
     

    You're right, the manual process described in the Inogic blog post highlights the complexity of working with the "Regarding" (or "Related") field of the Email entity, especially when linking to multiple records. Here's how to achieve this using Power Automate:

    Understanding the Challenge:

    The "Regarding" field is a polymorphic lookup, meaning it can refer to records from multiple entities (like Contacts, Accounts, Opportunities, etc.). Power Automate needs to handle this complexity.

    Power Automate Flow Steps:

    1. Trigger:

      • Choose a trigger that suits your scenario. For example:

        • "When a record is created" (Dataverse) - if you want to link related records when a new email is created.
        • "When a record is modified" (Dataverse) - if you want to link related records based on changes to an email.
        • "Recurrence" (Schedule) - if you want to run the flow periodically to update existing emails

    2. Get Email Record:

      • Use the "Get a row by ID" (Dataverse) action to retrieve the email record you want to update.
      • If your trigger is "When a record is created" or "When a record is modified," you can use the dynamic content from the trigger

    3. Identify Related Records (Contacts and Accounts):

      • This step depends on how you determine which Contacts and Accounts should be linked to the email.

      • Examples:

        • If the email's subject or body contains keywords related to specific Contacts or Accounts, use actions like "List rows" (Dataverse) and "Condition" actions to filter records based on those keywords.
        • If the email is related to a specific Opportunity or Case, get the related Contact and Account from those records.
        • If you have a custom lookup on the email record, use "Get a row by ID" to retrieve the related Contact or Account.

    4. Format the "Regarding" Field Data:

      • This is the critical part. The "Regarding" field requires a specific format:

        • An array of objects.
        • Each object contains:

          • @odata.type: The entity's OData type (e.g., /contacts, /accounts).

          • entityid: The record's GUID 
           

      • Create an Array:

        • Use the "Compose" action to create an array.
        • The input of the compose action should be:

      • Add Contact Object:

        • Use another "Compose" action to create the Contact object.
        • Input:

          • Replace <Contact GUID> with the actual GUID from your Contact record.
          • Then use the "Append to array variable" action, to append the output of this compose action to the array compose action.

      • Add Account Object:

        • Use another "Compose" action to create the Account object.
        • Input:

          • Replace <Account GUID> with the actual GUID from your Account record.
          • Then use the "Append to array variable" action, to append the output of this compose action to the array compose action.
            

    5. Update Email Record:

      • Use the "Update a row" (Dataverse) action.
      • Select the Email entity and the email record's ID.
      • In the "Regarding (Activities)" field, use the output of your array "Compose" action.

      •  

    Example Flow (Conceptual):

    1. Trigger: When an email is created.
    2. Get Email Record: Retrieve the created email.
    3. Get Related Contact: (e.g., based on a lookup field on the email).
    4. Get Related Account: (e.g., based on a lookup field on the email).
    5. Compose Contact Object:
    6. Compose Account Object:
    7. Compose Array:
    8. Append Contact to Array.
    9. Append Account to Array.
    10. Update Email Record: Set the "Regarding" field to the output of the array compose action.

    11.  

    Important Notes:

    • GUIDs: Make sure you're using the correct GUIDs for your Contact and Account records.
    • OData Types: The @odata.type values are case-sensitive and must be accurate.
    • Error Handling: Implement error handling in your flow to catch potential issues (e.g., missing related records).
    • Testing: Thoroughly test your flow in a development environment before deploying it to production.
    • Performance: If you're processing a large number of emails, consider optimizing your flow for performance.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • Suggested answer
    Ramesh Kumar Profile Picture
    on at
    How to update Related column of email entity using power automate flow
    Hi,
     
    Can you please give more details on the Business use case and also check if below link help
     
     
    Thanks
    Ramesh
     
    If this helped you, please check the box Does this answer your question?
  • Adam_Travers Profile Picture
    on at
    How to update Related column of email entity using power automate flow
    Hi, can you be more specific on what you are trying to achieve and I can help. 

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa Moderator

Leaderboard

Product updates

Dynamics 365 release plans