top of page
Neon Smoke

3 Ways To Format Agent Messages in Copilot Studio

Writer's picture: Angeliki PatsiavouAngeliki Patsiavou

Updated: 3 days ago

Have you been experimenting with Copilot Studio but want to diversify your messaging journey? Ever considered what ways you can format your agent’s output messages? Then look no further!


Why start your journey into the messaging galaxy


It is important to understand that agents are built to benefit people. Real users with real human needs. Thus, user experience, as well as accessibility, are not a nice to have anymore.


Here are the top reasons to be a guardian:


  1. Enhances readability by improving contrast and visibility: Proper line breaks, headings, and bullet points make text easier to scan and understand. Also, clear formatting, like semantic HTML tags, helps screen readers interpret content correctly for users with visual impairments. Bold, italics, or color-coding highlights important info, aiding users with low vision or cognitive impairments.

  2. Reduces cognitive load: Well-structured messages prevent overwhelming users with walls of text, making comprehension easier for those with dyslexia or ADHD. Numbered steps and section headers guide users with memory or attention difficulties through complex instructions.


  3. Minimizes errors and repetition, and thus message consumption: Breaking down content into sections or callouts prevents users from missing key details and needing repeated interactions. Repeated interactions cost money, whether you are buying capacity packs or using Pay-as-you-go. Ultimately, clear distinctions between questions, answers, and commands reduce confusion, also benefit. users with cognitive disabilities or non-native language speakers.


Let's explore these intergalactic options.


Option 1: Native formatting capabilities


Out-of-the-box capabilities are available in Copilot Studio as you set up your Topics messages.



Some of these include the usual Word-editor-like suspects:

  • Bolding text

  • Turning text into italics format

  • Numbering


Additionally, you can add a variable through the {X} icon in the Message node. For example, you can address a logged-in user by their first name. Alternatively, you can reuse a global (variable set up for use across topics) or local variable (used in a single topic) to incorporate existing information you have collected on this or another topic. This is great as you show the user you are maintaining context through the agent and facilitating the journey to the final outcome.


Another option, which is also native, is to incorporate Rich Media in your messaging journey. For example, an image, a GIF or a video. Of course, this can enhance your agent’s look and feel. However, always consider accessibility e.g. adding titles and alternative text. Plus, bear in mind users may interact in different devices with different bandwidth. So for example, a video may get laggy at times.


Option 2: Power Fx


A really exciting functionality, also native, but a bit more pro-code, is Power Fx. Lucky for us, this is also integrated into Copilot Studio messaging capabilities. The sky is the limit when it comes to how you can use Power Fx.


One example is to format numbers into currencies, considering you may be parsing plain numbers which then need converting into a specific currency format. A Text Power Fx expression can satisfy that requirement.


Please note that such expressions can include literal values or variables. These variables can be system, local or global ones.


Another cool scenario is to use Power Fx to manage conditions and outputs in a Topic. In practice, you have to switch in your Condition branch to the Power Fx editor through Change to formula. Then, you can start amending your formula as needed.


For an advanced guide on Power FX for Copilot Studio, you can see the Microsoft Learn guide here.


Option 3: Power Automate + HTML


When you manage topics, it is quite common to invoke flows. Power Automate can help with complex automation plus parsing values between systems and processes.


However, as we very well know, different systems speak different languages. This can be quite frustrating during the configuration process since it takes longer to put things together . As we parse for example JSON into an output for the agent to consume, we need to consider how it will render for users.


This is where HTML can come in handy. For example, you may want to have the results bulleted in a list format, or as a table, with appropriate gaps in between.


For example, in the below flow, I am calculating from the Dataverse data which rooms are available that a customer can choose to book at a specific hotel. The agent should show the results in a bulleted (unordered) list hence the HTML used in the string variable as it is passed back into Copilot Studio.


For example, in the flow on the right, I am calculating from Dataverse data which rooms are available that a customer can choose to book at a hotel.


The agent is expected to show the results in a bulleted (unordered) list. This is why HTML is used in the produced value before it is passed back as a string variable into the Copilot Studio Topic.



And if you are curious what the output is like in Copilot Studio...


As mentioned, it is first passed as a simple string since I have done the formatting in Power Automate through HTML.


This is pretty useful because no matter how many results have been retrieved through the flow, there is control over the output format with no intervention needed in the Topic itself.


Another reason why, when people ask me what skills are needed in learning to build agents, I always say Power Automate, HMTL and JSON skills are so core! Of course, these are part of general Power Platform skills, so they go hand-in-hand!



Then, in the actual user experience from the agent, the below is outcome. Sleek and simple. Not only is this in a bulleted list, but has currency formatting and the appropriate line breaks.


The intergalactic messaging journey does not end here


Whilst you have just read about 3 different ways to update the format of agent conversation, this is NOT where the journey ends.


There is another, more pro-dev way to do things.


And guess what, there will be a part 2 of this post to cover all about it.


Stay tuned guardians!

142 views0 comments

Recent Posts

See All

And remember, always build for real users, not senior egos

bottom of page