> For the complete documentation index, see [llms.txt](https://dyns.ntd.asia/power-dynamics/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dyns.ntd.asia/power-dynamics/d365-ce/copilot/add-copilot-into-rich-text-control.md).

# Add Copilot into Rich Text Control

Hello, my friends,

Did you use the Copilot on Email form?

<figure><img src="/files/d2N5lCl2ML43LqBKIn03" alt=""><figcaption><p>Copilot in the Email</p></figcaption></figure>

Both my client and I have tested this solution and found it effective. Copilot can enhance these suggestions by making them clearer, more concise, and more engaging.

Subsequently, I discovered that **this Copilot functionality** can be **integrated** with the **Rich Text Editor control** for **any desired entity**, enhancing its functionality.

## 1. How to add the Rich Text Editor control?

{% hint style="info" %}
**Reference link:** <https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/copilot-control>
{% endhint %}

I created a custom entity called "**Devices"** in my Sales Hub app.\
After that, I created a field "<mark style="color:red;">**Note**</mark>" - with type: *<mark style="color:red;">**Multiple lines of text**</mark>*

Okay.. firstly, I will add the *Rich Text Editor control* for the field "Note" on the Device's main form without any customizations.

<figure><img src="/files/oFpL3Al82nHD21uOnh3y" alt=""><figcaption><p>Origin Rich Text Editor Control - on Device form</p></figcaption></figure>

The original Rich Text Editor control (green box) has no **Copilot** butto&#x6E;**.**&#x20;

## 2. Customize Rich Text Editor Control - Add Copilot button

### 2.1 Create Web Resource - add Copilot to rich text editor control

Now, I will create the Web Resource to add the Copilot button in the Rich Text Editor control on the Device Main form.

In my solution, I created a web resource as below. You can find the sample code from [MS Link.](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/copilot-control)

<figure><img src="/files/JMG0irJIOCFkOQxF5gkV" alt="" width="563"><figcaption><p>Web Resource to add "Copilot" button in the Rich Text Editor control</p></figcaption></figure>

My sample code as below:

```javascript
// JavaScript
{"defaultSupportedProps": {
    "extraPlugins": "copilotrefinement",
    "toolbarLocation": "bottom",
    "toolbar":[{ "items": ["CopyFormatting","FontSize", "Bold", "Italic", "Underline", "BGColor", "CopilotRefinement"]}]
}
}
```

{% hint style="info" %}
For more Rich Text Editor control customization, you can find the [**Link**](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/rich-text-editor-control)**.**
{% endhint %}

### 2.2 Add Web Resource into Rich Text Editor control on the form

Finally, we need to add this web resource for the Rich Text Editor control on entity Form - as my sample is **Device form.** Then **Save and Publish** the form.

<figure><img src="/files/WKxJXJY1qQoYmbGVvVeO" alt=""><figcaption><p>Add Relative URL (of Web Resource) in the Static Value of the Rich Text Editor control</p></figcaption></figure>

{% hint style="info" %}
As Microsoft Recommendation:&#x20;

*"If you want to* [*customize the editor*](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/rich-text-editor-control#customize-the-rich-text-editor-control)*, enter the <mark style="color:red;">relative URL</mark> of its configuration file, a JavaScript web resource that contains the properties you want to change, in the <mark style="color:red;">**Static value**</mark> box. If you leave this field empty, the editor uses its default configuration".*
{% endhint %}

### Testing now\...

Check the result now\... :relaxed:

<figure><img src="/files/BhXlX26ifJq2XhJiHSSb" alt=""><figcaption><p>Testing - Copilot in Rich Text Editor</p></figcaption></figure>

**At present,** the Copilot feature for Rich Text Editor control is limited to refining paragraphs, but there is hope that this functionality will become more robust soon.

Thank you for reading & Hoping well. :tada: :goal:\
\&#xNAN;**\[NTD]yns.asia**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dyns.ntd.asia/power-dynamics/d365-ce/copilot/add-copilot-into-rich-text-control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
