Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

I have imported Rich Text Formatted data into Dynamics. Ho to Render it without the HTML?

(0) ShareShare
ReportReport
Posted on by 5

I have imported Notes from SharePoint and it is a Rich Text field in SharePoint. When we render it in Dynamics, we can see the HTML all up in the content and our client finds this unnaceptable. How can we render Rich Text Format on our SharePoint form? We have done research and from what we can tell, Dynamics has a OOB Rich Text data type but it can only be used for Email fields. I have attached 3 images. One of our data in SharePoint, the other as we pass it to Dynamics via Power Automate and finally he we see it rendered in our form in Dynamics. We are looking to improve this experience by rendering it correctly in Dynamics.

1. http://www.digitalcontentpros.com/DCP/Images/SchedulingNotesSharePoint.PNG

2. http://www.digitalcontentpros.com/DCP/Images/SchedulingNotesPowerAutomate.PNG

3. http://www.digitalcontentpros.com/DCP/Images/SchedulingNotesDynamics.PNG

  • cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: I have imported Rich Text Formatted data into Dynamics. Ho to Render it without the HTML?

    Hi Greg,

    Could it work for you?

    Regards,

    Clofly

  • GregGuth Profile Picture
    GregGuth 5 on at
    RE: I have imported Rich Text Formatted data into Dynamics. Ho to Render it without the HTML?

    This looks great! I'll try it and if it works I'll let you know and of course award your answer.

  • Suggested answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: I have imported Rich Text Formatted data into Dynamics. Ho to Render it without the HTML?

    Hi Greg,

    You could take me demo as reference:

    1. Create a HTML with code below: (I named it as RichTextRender.html)

    
    
    
        Rich Text Render
    
    
    
    
        

    The logic of my web resource is: 

    Query custom parameter from URL(the custom parameter here is a specific field of entity) -> Get value of the field -> Render the value(HTML source code) by setting them as HTML content of a div element 

    2. Pass a field as parameter to our web resource

    e.g: I saved HTML code in description field of Contact entity, and I want to render them as rich text.

    6457.JPG

    The URL of the web resource will be something like below when the web resource is loaded in form:(We can get the URL  by browser inspector.)

    https://crmxxx.crm.dynamics.com/{637268315600017751}/webresources/new_rich_text_render?data=description

    The code in web resource will retrieve specific field value with value from data parameter.

    3. Result:

    0412.pastedimage1591235668193v2.png

    (The web resource could only render HTML as rich text, I just copied HTML from this website https://html-online.com/editor/ for testing purpose, you can click QUICK TOUR to show demo HTML content if you can't see them by default.)

    We can deploy the web resource to any form, and set any field as parameter.

    Regards,

    Clofly

  • GregGuth Profile Picture
    GregGuth 5 on at
    RE: I have imported Rich Text Formatted data into Dynamics. Ho to Render it without the HTML?

    We reviewed the options you provided. Option 1 may be the best to fit our needs but There is not enough information there to really know. I would need to see an example or working source I can modify to go off of.

    Option 2 really looked promising but when we hit the links you provided, it looked like they were helping users place Rich Text editor onto their OOB email form. We aren't trying to do this we are just trying to display code that is already in Rich Text format.

    Option 3 would work except we are not using a Canvas app so that ruled us out.

    Option 4 is like option 2 they are helping users place RTE controls on a page. Again we don't need this we just want to render RTE codeed content properly...

    -Greg

  • GregGuth Profile Picture
    GregGuth 5 on at
    RE: I have imported Rich Text Formatted data into Dynamics. Ho to Render it without the HTML?

    I'm going to meet with the Dynamics developer this evening to discuss the options you laid out and we will probably split them up and try a couple of them. I will most likely be doing the PowerApps one. I'll let you know as we progress. Thanks for the feedback. Other posts have asked similar questions and none had as good as a response as the one you gave.

    -Greg

  • cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: I have imported Rich Text Formatted data into Dynamics. Ho to Render it without the HTML?

    Hi Greg,

    Could any one of these options works for your requirement?

    Steps are detailed in tutorials I posted if you would like to render HTML by custom control without many code.

    Or if you prefer to render HTML by javascript directly, I'm willing to share a simple demo for you.

    Please let me know whether you have any doubt.

    Regards,

    Clofly 

  • Suggested answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: I have imported Rich Text Formatted data into Dynamics. Ho to Render it without the HTML?

    Hi Greg,

    There are many options for us to enable render Rich Text Format:

    Web resource(custom javascript code is required):

    1. Create a custom HTML web resouce, read field which saves HTML code by "parent.Xrm.Page.getAttribute("xxx")"(or by Web API) at onLoad event of the web resource,

     then render content by document.write("HTML code") or document.getElementById("xxx").innerHTML = "HTML code"

    2. Render HTML with 3rd party Rich Text Editor library:

    http://hauge.cloud/2017/06/08/how-to-enable-rich-text-in-dynamics-crm-using-ckeditor/

    Modern way(low code):

    3. Render HTML with "Rich text editor" control of Canvas App, then import the app as control in Dynamics

    https://evolved365.com/2019/05/02/embedding-a-rich-text-controller-to-a-field-using-a-canvas-app/ 

    4. Import a rich text editor control from PCF.gallery(see what it is), there are many useful custom controls in PCF.gallery website! 

    The RTE control:

    https://pcf.gallery/tinymce-rich-text-editor/

    How to deploy the control to our environment:

    https://carldesouza.com/how-to-install-powerapps-components-from-pcf-gallery-to-your-org/

    Regards,

    Clofly

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans