cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ferdl
New Member

Boolean, save to MySQL as -1, not as 1

Hello community,

 

I have an App with functions like this:

 

 

Patch('Backend.tblNachverfolgung';
        First(Filter('Backend.tblNachverfolgung';nachvID = First(colProjektDetails).nachverfolgungID));{nachvTagesplan: If(chkTagesplan.Value;-1;0)})

 

 

I simply try to patch a boolean value into a MySQL table. The field is 'nachvTagesplan' and of the type tinyint(1) in MySQL. The Table stores false as 0 and true as -1. I am using this table also in MS Access and works fine there.

If I now try to patch a true Value from my PowerApps it always stores it as 1. So I have the problem, that my MS Access isnt working any longer because of the missing '-'.

 

Is there a possibilty to tell Powerapps it has to store true values as '-1' and not as '1'?

i also tried things like

 

 

{nachvTagesplan: chkTagesplan.Value}
or
{nachvTagesplan: If(chkTagesplan.Value;Int(-1);0)}

 

 

 

Any ideas?

Thanks a lot!

1 REPLY 1
timl
Super User
Super User

@Ferdl 

If the underlying data type of your nachvTagesplan column is tinyint, it's necessary to patch either -1 or 0 in the way that you're currently doing.

There's no way in Power Apps to automatically coerce Boolean true values to -1.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,250)