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 / If statement in HTML I...
Power Apps
Answered

If statement in HTML Input text in Powerapps

(0) ShareShare
ReportReport
Posted on by 480

I have a powerapps form linked to Sharepoint List. I have a button in it that creates a PDF file for which i wrote an HTML code in Powerapps. In this PDF i need one field to appear if department is XYZ else it should not be visible.

Kindly help.

Categories:
  • Softbear Profile Picture
    58 on at

    Hey @cyberco01 , you can write "&&" to insert a function into the HTML editor in PowerApps 🙂 Like:

    "

    "&If(Sky=Blue,true,false)&"

    Show your <b><font color=blue>HTML</font></b> text here.

    "

     

    Hope it solves the issue!

  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    Hi @cyberco01 

     


    In the html code example below, use If function to check department 

     

    "<b>This is my html code </b>" & If(Department = "XYZ","<b> Department is XYZ </b>") & "<b> More html code</b>"

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It didn't work. Ends up printing the function as typed on my html & PDF files as part of a paragraph.

    Should it not be in a <p> tag?

    NB: I am on Compose control in Flow

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It didn't work. Ends up printing the function as typed on my html & PDF files as part of a paragraph.

    Should it not be in a <p> tag? 

    NB: I am on Compose control in Flow

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard