egonzalez
Posts: 0
Joined: Fri Sep 14, 2012 9:34 pm

Problem using Checkbox and POSTing to ParseDB using Boolean Type

Having trouble mapping checkbox to Boolean type in ParseDB. The component has a default value of true but the service throws the following error when invoked:

"error": "invalid type for key ptaNotes, expected boolean, but got string"

So I added javascript to the mapping.

return Boolean();

This allows service to be invoked successfully but always passes in 'true'.

So I changed the javascript to.

return Boolean(value);

This allows service to be invoked successfully but always passes in 'false'.

Neither of these solutions are passing in the actual value. What am I missing? I am obviously new to this.
Thanks!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Problem using Checkbox and POSTing to ParseDB using Boolean Type

Do:

code
console.log(value);
/code
to see what you actually get.

egonzalez
Posts: 0
Joined: Fri Sep 14, 2012 9:34 pm

Problem using Checkbox and POSTing to ParseDB using Boolean Type

That was the first time I used console.log(value) and I didn't realize how helpful that is. I feel like I'm learning javascript in reverse but it's still fun to see things come together so fast. Thanks again!

Return to “Issues”