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
Super User
Super User

@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
Super User
Super User

@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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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