Niels
Posts: 0
Joined: Fri May 02, 2014 12:36 am

Boolean and checkbox

Hello community,

I'm having a problem with booleans and corresponding checkboxes.

I have a boolean in my DB, which I'd like to control directly through a checkbox. I run a create service that gets triggered with a value change of the checkbox.

But instead of changing just the boolean in my data set, it creates a new data set entry or does nothing at all, when unchecking the checkbox.

What am I doing wrong?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Boolean and checkbox

Hi Niels,

Please can you show us your service settings and mapping?

Niels
Posts: 0
Joined: Fri May 02, 2014 12:36 am

Boolean and checkbox

Niels
Posts: 0
Joined: Fri May 02, 2014 12:36 am

Boolean and checkbox

I should mention that the data is previously read into the form above. Once there, I would like to be able to change the values in the checkboxes (true or false in the DB), so that they will be changed immediately in the DB.

Is that possible?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Boolean and checkbox

Hello Niels, sorry for the delay.

For updating your records in appery.io DB you should use update service: http://docs.appery.io/documentation/b...

Niels
Posts: 0
Joined: Fri May 02, 2014 12:36 am

Boolean and checkbox

Hello Evgene,

the checkbox is still not updating the DB. I mapped the update service as seen above, but the Selected value is not working with the boolean in the DB.

I tried both click and selected as event.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Boolean and checkbox

Hello, Niels

Are there any errors in the browser console?

Niels
Posts: 0
Joined: Fri May 02, 2014 12:36 am

Boolean and checkbox

Hello Evgene,

yes, there is

{"code":"DBSU252","description":"Invalid value for type 'boolean': 'results_vorrat'."}

I checked the value for the corresponding request, which is string.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Boolean and checkbox

Hi Niels,

To get an appropriate boolean value from checkbox you should change your mapping, delete arrows from checkbox to corresponding parameters in request.

Add JS to those boolean parameters (http://docs.appery.io/documentation/r...). Use code like this: prereturn $("#Screen1_mobilecheckbox_3").prop("checked");/preWhere Screen1 is your page name,
mobilecheckbox_3 is a name of your checkbox component.

Return to “Issues”