Skip to main content

Notifications

Community site session details

Community site session details

Session Id : bapTzjlfMQ31o2gE3LcGgt
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 Super User 2025 Season 1 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
    34,939 Super User 2025 Season 1 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard