web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : iSnGJOKvksh1RhG9Z8azKy
Power Apps - Building Power Apps
Answered

how to handle Boolean value in Datatable

Like (0) ShareShare
ReportReport
Posted on 2 Oct 2019 00:35:40 by 70

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

 

 

Categories:
  • leden Profile Picture
    26 on 14 Mar 2024 at 08:54:13
    Re: how to handle Boolean value in Datatable

    As an added bonus to the bizarre behavior described by Jason Smith, now when I click the checkbox in the data table it freezes my app! (restart necessary). As users will tend to click check-boxes in order to change their status, this is pretty serious. I am going to try to replace with text columns saying "Yes" or "No" to discourage that wanton clicking behavior to avoid the "your app keeps freezing on me" complaints.

  • toto2005 Profile Picture
    4 on 22 Dec 2023 at 08:34:37
    Re: how to handle Boolean value in Datatable

    Remove then "Text" property of your checkbox

  • JasonSmithTBS Profile Picture
    46 on 29 Jul 2022 at 11:27:11
    Re: how to handle Boolean value in Datatable

    This is absolutely a bug! The solution proposed by @mdevaney is an elegant work around, at least for those who can use a font supporting his solution. Other users in this thread have proposed what I feel is the best correction/solution to the current bug. Simply leave the column's control type to Boolean and select the column and clear or comment out the Text property that it defaulted. This works exactly as you'd expect the control to work in the first place for Boolean columns.

     

    Hopefully the team working on the Data Table control will fix this issue for Boolean control type columns, it seems simple enough.

     

    Once fixed by clearing the Text property there still seems to be a slightly bizarre behavior but not one that seems to affect anything sever I can tell yet. Text columns show the text cursor and allow selecting the row by clicking where as the boolean column changes the cursor to an arrow. Clicking anywhere within the row highlights as normal and retains the look of the boolean column's checkbox however if you click on the checkbox itself it dims like its selected or something but there is no status change of the checkbox. Not sure what, if anything, the purpose of dimming the checkbox was meant for but hopefully, as the DataTable control evolves we will find out.

  • Community Power Platform Member Profile Picture
    on 08 Feb 2021 at 15:32:13
    Re: how to handle Boolean value in Datatable

    Really, this is acceptable to need to create an If statement with unicode characters?  To me it's a bug.

  • AlvaroYurrita Profile Picture
    4 on 16 Jan 2021 at 20:39:52
    Re: how to handle Boolean value in Datatable

    I just stumbled into this same problem. Select the column, and on the Text property you probably have a residual: ThisItem.'Has attachments'. This will trigger the checkbox to be selected all the time, no matter the font.  Simple delete all the contents of the Text property, and the checkbox will work correctly

  • __aboot Profile Picture
    14 on 06 Jan 2021 at 13:49:37
    Re: how to handle Boolean value in Datatable

    Yes, @JamesThurber is 100% correct. Select the column with the boolean values (where all checkboxes are shown as selected), then remove the formula within the text property of this column (mine was ThisItem.XY), 

    __aboot_0-1609939900858.png

    Then you achieve also displaying empty checkboxes.
    (Maybe seen from a logical standpoint, the datatable only checks if there is a value, which is with regards to boolean always the case (true/false or yes/no are values vs. NULL, which is not a value).)
    So after removing the formula it works as intended.

    __aboot_1-1609940965391.png

     

  • Michael Seerup Profile Picture
    170 on 13 Jun 2020 at 10:00:39
    Re: how to handle Boolean value in Datatable

    Deleting the Text formula worked for me. 

     

     

  • Xiangchen_2019 Profile Picture
    70 on 22 Apr 2020 at 20:58:03
    Re: how to handle Boolean value in Datatable

    @JamesThurber Got it. Thank you. Xiang

  • JamesThurber Profile Picture
    10 on 22 Apr 2020 at 15:13:39
    Re: how to handle Boolean value in Datatable

    I came across the same issue @Xiangchen_2019 & @mdevaney .  Every checkbox in the datatable was checked even when it should have been unchecked.  I played with the functions and still didn't like the results.  Then I accidentally deleted the Text field for the column and the checkboxes are filled accurately now.

     

    So to get the checkboxes in the column to react correctly to a boolean value just remove the Text value for the column.

  • Xiangchen_2019 Profile Picture
    70 on 02 Oct 2019 at 03:00:28
    Re: how to handle Boolean value in Datatable

    @mdevaney 

     

    It works for me. Thank you so much!

     

    @RezaDorrani 

    Thank you so much for all your time and efforts.

     

    Xiang

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473