cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jclaraf
Frequent Visitor

CheckBox and SQL Server datatype bit

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

5 REPLIES 5
timl
Super User
Super User

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)}

 

mdevaney
Super User
Super User

@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."

jclaraf
Frequent Visitor

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 

jclaraf
Frequent Visitor

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
Frequent Visitor

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

 

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,942)