cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

how to handle Boolean value in Datatable

Hi,

 

I have a datatable connect to DB table. this table has two columns, which is 1 or 0. I have choose checkbox to show this boolean value in the datatable. but the checkbox has been checked no matter the value is 1 or 0.

 

Please advise how to make the checkbox is checked only for the 1 value.

 

Thanks,

 

Xiang

see screenshot:

 

datatable - PowerApps.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Xiangchen_2019 

Try this: change the control type to a Text Column using the Edit Fields menu

 

img10.png

 

Then, select the confirmed column and put this code in the Text property.  Do the same for the registered column.  It worked for me! 

 

If(ThisItem.PerDiem,"☑","☐")

 

@RezaDorrani 

I think manually defining the outputs using a Unicode symbol will work here.  However, I did not think of that approach until you showed us the idea to change the control type idea.  Thank you for taking the time during your evening to help us out.  I very much appreciate it!  Smiley Happy

 

 

View solution in original post

16 REPLIES 16
mdevaney
Community Champion
Community Champion

@Xiangchen_2019 

A checkbox is appearing because your Data Table is using the font Open Sans.  Try something different like Segoe UI or Arial and the values will display properly.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

@mdevaney 

 

Thank you. I have tried, but the checkbox still has been showed as checked. I want to show the checkbox, but I want to the checkbox got checked once is '1' and unchecked once it is '0'.

 

the screensht is as below:

 

datatable 2- PowerApps.png

@Xiangchen_2019

Do any of the available fonts show something different than a checkbox for you?

@mdevaney,

 

 

I have tried all the other font, all shows the checkbox as checked.

 

Thanks,

 

Xiang

mdevaney
Community Champion
Community Champion

@RezaDorrani 

Hi there Reza.  It appears you are online at this moment so I hope you don't mind me asking a question.  Smiley Happy

 

@Xiangchen_2019  has a true/false field showing as a checkbox no matter what value true/false.  Is this something you have encountered before?  Changing fonts seems to work for me but it doesn't appear to be the solution for them.

Hi @mdevaney & @Xiangchen_2019 

 

I am not sure how checkbox is showing as an option in the first place

Just tested with a bit type column in the DB and these are the only options a DataTable in PowerApps provides me afor this type of column

Capture.PNG

 

I have tried all fonts as well - but mine stays consistent as toggle and also shows accurate data

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 @RezaDorrani and @mdevaney 

 

My bit type column shows as ""boolean column" in data table. see screenshot. I do not have toggle column as option at all.

confirmed - PowerApps.png

@Xiangchen_2019 

Try this: change the control type to a Text Column using the Edit Fields menu

 

img10.png

 

Then, select the confirmed column and put this code in the Text property.  Do the same for the registered column.  It worked for me! 

 

If(ThisItem.PerDiem,"☑","☐")

 

@RezaDorrani 

I think manually defining the outputs using a Unicode symbol will work here.  However, I did not think of that approach until you showed us the idea to change the control type idea.  Thank you for taking the time during your evening to help us out.  I very much appreciate it!  Smiley Happy

 

 

@mdevaney 

 

It works for me. Thank you so much!

 

@RezaDorrani 

Thank you so much for all your time and efforts.

 

Xiang

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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,451)