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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

How to read/parse the content of email body including lookup values ?

(0) ShareShare
ReportReport
Posted on by 255

Hi folks,

I have a requirement like, whenever a case record is created from the email activity. The email body containing the Subject, Origin, Description and some other Custom field values and that would be populated when Case is created.
Since Subject and origin are the Optionset values in Case entity. I wonder how this can be achieved using a plugin on create of Case record. I don't  know much about the Regex expression to parse the email body content.
Any help would be certainly helpful to me.

Regards,

Anant 

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Anant,

    As you mentioned above, ‘a case record is created from the email activity’.

    There is a button named ‘Covert to case’ on the entity form.

    pastedimage1609903065514v1.png

    When you click it, one dialog will open, you can fill fields you need(Subject field).

    pastedimage1609903133252v2.png

    After clicking convert button, one new case record will be created, and origin field has filled automatically, email activity has added to the timeline.

    pastedimage1609903224236v3.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Anant Profile Picture
    255 on at

    Thats right. but, the requirement is like i have to fetch Subject, Origin and Asset ID(Custom field) data from email body and put these into the respective Case field when Case is created from Email.

  • Community Member Profile Picture
    on at

    Hi Anant,

    You mean that you don’t use ‘Convert to case’ button to create case from email? Which way you are using to create case from email?

    And you can use web api or power automate to retrieve email to get fields value about it.

    Xrm.WebApi.retrieveRecord(entityLogicalName, id, options).then(successCallback, errorCallback);

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-webapi/retrieverecord 

    list records action in the power automate.

    carldesouza.com/.../

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Anant Profile Picture
    255 on at

    Hi Leah,

    I am using that "Convert to Case" Button to create a Case from Email Activity. Requirement is the mail body containing SerialID: {string value}, Description: {string value} should be auto filled on Case's Serial Number and Description field while creating Case record.

    Right now, this cant be achieved OOB.

    Regards,

    Anant

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Anant,

    Maybe you can try to user power automate to create flow to get value from email to case when case is created.

    1.Go Power Automate(https://us.flow.microsoft.com/en-us/ ) to create automated cloud flow.

    2.Set ‘when a record is created’ as trigger.

     pastedimage1610003635578v1.png

    3.Add ‘List record’ action to fetch email by filter—regarding field eq case.

    If the case is converted from email, only one email’s regarding field value is the case.

    pastedimage1610005803733v2.png

    4.Add ‘Update a record’ to update case with value from email.

    and 'Apply to each' action will be created automatically after adding update action, don't add it manually.

    pastedimage1610008257069v5.png

    5.Due to the email being in rich text format, therefore it will show with the HTML Tags visible inside the case description field.

    pastedimage1610009584903v1.png

    Now "Rich Text Editor Control" is available in latest Dynamics 365 version (2020 release wave 2 enabled).

    You can go Settings > Customizations > Customize the system > entities > case > forms to open case main form, then double-click description field to open ‘Field Properties’ dialog.

    Move to ‘Control’ tab to select ‘Rich Text Editor Control’.

    pastedimage1610008026879v4.png

    If you are not in the latest version, you need Search for “Content conversion HTML to text”. Select the Html to text (preview) Content Conversion action in power automate steps.

    pastedimage1610009657126v2.png

    pastedimage1610009663472v3.png

    6.Test.

    When you click 'convert to case' to navigate to case form, you need click ‘Save’ button in case form and wait for minutes and refresh current form.

    Serial number and description field will be filled automatically.

    pastedimage1610008379653v6.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Anant Profile Picture
    255 on at

    Hi Leah,

    Thank you for the screen shots that you have shared above in regards with the Power Automate.

    In the above sharing i found that Serial ID is used as a separate field on Email Entity.

    My requirement was like, i am using email template in Email Body in which i have added Dynamics Text from Case entity that is Serial ID and Description.

    Scenario is when Key user enters the Serial ID and Description on email, it should be populate on Serial Number and Description of Case record.

    Regards,

    Anant

  • Community Member Profile Picture
    on at

    Hi Anant,

    For ‘i am using email template in Email Body in which i have added Dynamics Text from Case entity that is Serial ID and Description.’ I can’t understand it.

    Where Serial ID in email form? Can you provide screenshot about it?

    Regards,

    Leah Ju

  • Anant Profile Picture
    255 on at

    Hi Leah,

    please have a look on the below screenshot.

    pastedimage1610431729506v1.png

    In this, Customer will enter Serial ID and Description manually inside the Email Body.
    Whenever Dispatcher converts this mail to a Case record, both these values from the email body will be reflected inside the Case record (Serial Number and Description).

    pastedimage1610432742391v2.png

    Regards,
    Anant

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Anant,

    You can add four ‘compose’ action between ‘html to text’ and ‘update a record’ actions, I use String functions to read and extract value you need in ‘compose’ action.

    pastedimage1610441813990v1.png

    The following is detailed steps:

    1.first ‘compose’ action.

    last(split(outputs('Html_to_text')?['body'],'Serial ID:'))
    pastedimage1610442188519v2.png

    2.second ‘compose’ action.

    first(split(outputs('Compose'),'Description'))
    pastedimage1610442328189v3.png

    3.third ‘compose’ action.

    last(split(outputs('Html_to_text')?['body'],'Description:'))
    pastedimage1610442439288v4.png

    4.fourth ‘compose’ action.

    first(split(outputs('Compose_3'),'Please'))
    pastedimage1610442583970v5.png
    Note:
    compose1 and compose2 get value between 'Serial ID:' and 'Description';
    compose3 and compose4 get value between 'Description:' and 'Please'.
    pastedimage1610443022125v9.png

    5.Update case fields with ‘compose2’ and ‘compose4’.

    pastedimage1610442805964v6.png

    Test Results:

    email:

    pastedimage1610442860868v8.png

    case:

    pastedimage1610442832248v7.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    CRMJetty Profile Picture
    3,512 on at

    Hello,

    pls refer this article

    https://dreamingincrm.com/2015/12/12/convert-to-case-displaying-email-contents/

    I hope it helps,

    Thanks.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 61 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans