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

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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,883)