Skip to main content
Community site session details

Community site session details

Session Id : /ya8cQnLwdPJ+kdTPMyCae
Power Apps - Building Power Apps
Unanswered

CheckBox and SQL Server datatype bit

Like (0) ShareShare
ReportReport
Posted on 23 May 2020 11:15:46 by 35

Hi everybody,

I have a Checkbox which is relationated with a column of a table in SQL Server. This column has bit as datatype
The Checkbox is a control into a Gallery. I build a formula for property Default of the Checkbox and it woeks correct
But when I aply the similar a formula for property OnSelect I receive and error message of SQL Server: "Cannot be converted to numeric"
I don't find where is the problem.
I add a document whit both formulas
Can someone help me?
Thanks

  • jclaraf Profile Picture
    35 on 24 May 2020 at 16:21:29
    Re: CheckBox y bit de tipo de datos de SQL Server

    I have seen that happens the same with another field. I add a new document as example. In this example you can see that field is numeric but the SQL Server says it's no numeric. the problem isn't that field are bit o numeric. SQL Server return the same error   

    Any help will be welcome

     

     

  • jclaraf Profile Picture
    35 on 23 May 2020 at 14:09:30
    Re: CheckBox and SQL Server datatype bit

    Patch(
    '[dbo].[EstadistiquesPartits]';
    First(
    Filter(
    '[dbo].[EstadistiquesPartits]';
    Temporada = GJornada.Selected.Temporada;
    categoria = GJornada.Selected.Categoria;
    idClub = GJornada.Selected.clubequiplocal;
    DivisiĂł = GJornada.Selected.DivisiĂł;
    Grup = GJornada.Selected.Grup;
    Jornada = Value(NJornada.Text);
    Partit = GJornada.Selected.idpartit;
    Jugador = ThisItem.Jugador
    )
    );
    {Convocat:If(Checkbox1.Value;1;0)}
    )

  • jclaraf Profile Picture
    35 on 23 May 2020 at 14:09:14
    Re: CheckBox and SQL Server datatype bit

    Sorry,

    I have change de formula:

    Patch(
    '[dbo].[EstadistiquesPartits]';
    First(
    Filter(
    '[dbo].[EstadistiquesPartits]';
    Temporada = GJornada.Selected.Temporada;
    categoria = GJornada.Selected.Categoria;
    idClub = GJornada.Selected.clubequiplocal;
    DivisiĂł = GJornada.Selected.DivisiĂł;
    Grup = GJornada.Selected.Grup;
    Jornada = Value(NJornada.Text);
    Partit = GJornada.Selected.idpartit;
    Jugador = ThisItem.Jugador
    )
    );
    {Convocat:If(Checkbox1.Value;1;0)}
    )

     

    But I have the same error 

  • mdevaney Profile Picture
    29,987 Moderator on 23 May 2020 at 11:37:33
    Re: CheckBox and SQL Server datatype bit

    @jclaraf 

    Change this section of code in your Default property

    {Convocat: Checkbox1.Value}

     

    Into this code

    {Convocat: If(Checkbox1.Value, 1, 0)}

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • timl Profile Picture
    35,382 Super User 2025 Season 2 on 23 May 2020 at 11:37:12
    Re: CheckBox and SQL Server datatype bit

    Hi @jclaraf 

    Although I haven't time to test this, could you try changing that particular part of you code to this, and see if that helps?

    {Convocat: If(Checkbox1.Value, 1, 0)}

     

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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