cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zuurg
Resolver I
Resolver I

Show Sharepoint List Yes/No in HTMLText control

The app I'm building uses a Sharepoint List which has a Yes/No column. 

I'm using an HTML Text control to build the HTML that will be saved by a Flow and then converted to a .PDF by the same flow.  What do I need to add to the HTMLText box to show a checked checkbox when the value in the List is Yes?   Note that I am not looking to have the user interact with the HTML file, it's just being used for a report.

1 ACCEPTED SOLUTION

Accepted Solutions
metsshan
Solution Sage
Solution Sage

Resources:

https://www.w3schools.com/tags/att_input_checked.asp 

https://powerusers.microsoft.com/t5/Building-Power-Apps/HTML-formatting-with-variables/td-p/706038

 

Source Data:

metsshan_2-1658978304731.png

 

Checked based on "Active" column:

metsshan_0-1658978268069.png

metsshan_1-1658978287438.png

 

Code:

"<input type=""checkbox"" name=""vehicle1"" value=""Bike""" & If(First(People).Active, " checked") & ">
<label for=""vehicle1""> I have a bike</label><br>"

 

Edit: If you don't want users to be able to toggle it, you can also use the disabled property, but you may need to add extra formatting to change the appearance: https://www.w3schools.com/tags/att_input_disabled.asp 

 

"<input type=""checkbox"" name=""vehicle1"" value=""Bike""" & If(First(People).Active, " checked") & " disabled>
<label for=""vehicle1""> I have a bike</label><br>"

 

View solution in original post

2 REPLIES 2
metsshan
Solution Sage
Solution Sage

Resources:

https://www.w3schools.com/tags/att_input_checked.asp 

https://powerusers.microsoft.com/t5/Building-Power-Apps/HTML-formatting-with-variables/td-p/706038

 

Source Data:

metsshan_2-1658978304731.png

 

Checked based on "Active" column:

metsshan_0-1658978268069.png

metsshan_1-1658978287438.png

 

Code:

"<input type=""checkbox"" name=""vehicle1"" value=""Bike""" & If(First(People).Active, " checked") & ">
<label for=""vehicle1""> I have a bike</label><br>"

 

Edit: If you don't want users to be able to toggle it, you can also use the disabled property, but you may need to add extra formatting to change the appearance: https://www.w3schools.com/tags/att_input_disabled.asp 

 

"<input type=""checkbox"" name=""vehicle1"" value=""Bike""" & If(First(People).Active, " checked") & " disabled>
<label for=""vehicle1""> I have a bike</label><br>"

 

Thanks, this is perfect.  I guess I have to teach myself CSS now to have it not look like roadkill.    🙂

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,511)