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 / Power Apps / HtmlText code gets bro...
Power Apps
Answered

HtmlText code gets broken due to using & in the dynamic text

(0) ShareShare
ReportReport
Posted on by

Dear all,

I have the following issue:

  • I'm using the HtmlText component to generate a QR code with contact information
  • part of the code is also department and Organization name, which I'm getting from the Office365User connector and which are displayed on a second screen of the app as text labels
  • whenever the text label contains "&" symbol, it breaks the HTML code which I'm using to generate the QR code
  • example of the code is below:
    "<img src='https://api.qrserver.com/v1/create-qr-code/?data=BEGIN%3AVCARD%0AVERSION%3A3.0%0AFN%3A" & Name.Text & "%0AN%3A" & Office365Users.MyProfile().Surname & "%3B" & Office365Users.MyProfile().GivenName & "%0ATITLE%3A" & JobTitle.Text & ", " & Department.Text &"%0ATEL%3BWORK%3BVOICE%3A%2B" & Mobile.Text & "%0AEMAIL%3BWORK%3BINTERNET%3A" & Email.Text & "%0AURL%3Ahttps%3A%2F%2Fwww.google.com%0AADR%3A%3B%3B" & Address.Text & "%3B" & Office365Users.MyProfile().City & "%3B%3B" & Office365Users.MyProfile().PostalCode & "%3B" & Country.Text & "%0ATEL%3BWORK%3BVOICE%3A%2B" & Phone.Text & "%0AORG%3A" & Company.Text & "%0AEND%3AVCARD%0A&margin=0&size=550x550&qzone=4'>"​

Is there a way to keep "&" in the text label and use the code below as well?

Categories:
I have the same question (0)
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Replace your & inside the text bits with %26

     

    you can see in your url bits you already have things like %3A (its a colon)

     

    You can find a list of URL encoding references here:

    HTML URL Encoding Reference (w3schools.com)

     

    Cheers,

    Sancho

  • xsomej33 Profile Picture
    on at

    Thanks for a quick answer @iAm_ManCat - so in case the label includes "&", I'll just replace it with "%26", correct?

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    For example the end bit of your code:

    "%0AEND%3AVCARD%0A&margin=0&size=550x550&qzone=4'>"​

     becomes

    "%0AEND%3AVCARD%0A%26margin=0%26size=550x550%26qzone=4'>"​

     

  • xsomej33 Profile Picture
    on at

    Thanks @iAm_ManCat for the help. I can confirm this is now working:

    xsomej33_1-1684752581802.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard