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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / HTML tags showing in u...
Copilot Studio
Suggested Answer

HTML tags showing in user input ( issue in Teams chat)

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

I’m facing an issue in Copilot Studio (Teams channel) and need some guidance.

When a user sends a message sometimes is shows <div> tag:
Thanks

the bot displays it exactly as (from users end):
<div>Thanks</div>
instead of rendering or converting it to plain text (Thanks).

So essentially, HTML tags from user input are not being sanitized or stripped, and they appear directly in the chat.

 

Setup:

  • Topic is triggered using “A message is received”
  • Response is sent using a Message node
  • We are not using Adaptive Cards and need to continue with Message node only

What I’ve checked so far:

  • This is user input, not something generated from the bot response
  • The issue occurs in the Teams channel
  • I’m not explicitly adding any HTML formatting in my topic or flow
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    This happens because Teams sends some user messages as HTML, and Copilot Studio does not sanitize or render HTML in Message nodes. The raw tags (like <div>) are passed through as plain text. This is expected behavior in the Teams channel. If you need clean text, you’ll need to strip HTML tags yourself before sending the response.

    One option you may try: Strip HTML yourself
    Use a small cleanup step before sending the response.
    If you’re using a flow / tool call:
    Remove tags using a regex or replace logic
    Conceptually:
    remove <...> tags > keep inner text
    Even a simple replace for common tags (<div>, </div>) often solves 90% of cases.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

    Sunil Kumar Pashikanti, Moderator
    Blog:
     https://sunilpashikanti.com/posts/
  • Suggested answer
    Sayali-MSFT Profile Picture
    Microsoft Employee on at
    Hello @CU28040802-0,
    In Microsoft Teams, bot messages (including those handled via Copilot Studio) do not support HTML rendering. User input is passed to the bot as plain text via the Bot Framework, and Copilot Studio does not automatically sanitize or strip HTML tags. As a result, any HTML-like input (e.g., <div>Thanks</div>) is treated as literal text and displayed as-is in the chat. This is expected behavior by design for security and consistency reasons.

    Use a replace expression in your topic:
    Example:
    Substitute( Substitute(userInput, "<div>", ""), "</div>", "")

    For broader cleanup (basic approach):
    Substitute(Substitute(Substitute(...)))

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 277

#2
11manish Profile Picture

11manish 206

#3
sannavajjala87 Profile Picture

sannavajjala87 156 Super User 2026 Season 1

Last 30 days Overall leaderboard