How to Import Checkbox fields

Discuss HanDBase running on various Palm OS devices and synchronization with desktop computers.

How to Import Checkbox fields

Postby Shepherd Jim » Thu Sep 24, 2009 10:28 am

I'm back with another import/export problem: (HDB 4.1.6 on a Palm Centro smartphone, HDB Desktop 4.1.5 on PC/XP)

I export a database/table from Alpha Five (Ver 8) to a text .csv file. Three "logical" fields have "T"s and "F"s in them. The "T"s and "F"s show correctly in both a listing in Alpha Five and the .csv file viewed in Excel.

I then import the .csv into an existing HDB .pdb database where those three fields are "Checkboxes", and ALL the boxes are checked -- meaning that, effectively, all the "F"s have become "T"s.

Is there an simple way to avoid this? I'm guessing that if I went into the database in Excel and replaced all the "F"s with blanks " "s and THEN imported, the resulting "false" checkboxes would be UNchecked?

Jim
i wish i knew then what i know now
Shepherd Jim
 
Posts: 116
Joined: Mon May 25, 2009 3:28 pm
Location: Bristol, Maine USA

Re: How to Import Checkbox fields

Postby dhaupert » Thu Sep 24, 2009 11:43 am

Shepherd Jim wrote:I'm back with another import/export problem: (HDB 4.1.6 on a Palm Centro smartphone, HDB Desktop 4.1.5 on PC/XP)

I export a database/table from Alpha Five (Ver 8) to a text .csv file. Three "logical" fields have "T"s and "F"s in them. The "T"s and "F"s show correctly in both a listing in Alpha Five and the .csv file viewed in Excel.

I then import the .csv into an existing HDB .pdb database where those three fields are "Checkboxes", and ALL the boxes are checked -- meaning that, effectively, all the "F"s have become "T"s.

Is there an simple way to avoid this? I'm guessing that if I went into the database in Excel and replaced all the "F"s with blanks " "s and THEN imported, the resulting "false" checkboxes would be UNchecked?

Jim


Hi Jim,

Good question. When a CSV is imported, anything other than a blank value or a zero value is treated as checked. So you have a few options to get that data in there then.

You could do as you mentioned- do a search and replace to change it on the Alpha Five side.
You could import as a text field in HanDBase and then add a conditional field that says if the text field is F the value is 0, otherwise, it's 1. Then after setting that field up and the program recalculated, you can convert the conditional to a checkbox and get the right values.

Hope one of these work for you!
dhaupert
 
Posts: 4113
Joined: Tue May 26, 2009 11:51 am

Re: How to Import Checkbox fields

Postby idamtnboy » Wed Nov 28, 2012 11:57 pm

dhaupert wrote:
Hi Jim,

Good question. When a CSV is imported, anything other than a blank value or a zero value is treated as checked.

Has something changed since you wrote this, or did you get it wrong? I just did an import with checkbox fields. The csv file had -1 for the checked values, and blank for unchecked. All the blank values imported as checked resulting in all the boxes in the HB db being checked. I went into the csv file and changed all the blank values to zero and then they imported as unchecked.
idamtnboy
 
Posts: 44
Joined: Sun Sep 23, 2012 9:21 pm

Re: How to Import Checkbox fields

Postby dhaupert » Thu Nov 29, 2012 7:40 am

I honestly don't remember changing that, but it is an almost 4 year old post, so a lot has happened since then! It sounds like the program is specifically looking for a 0 for unchecked to me.
dhaupert
 
Posts: 4113
Joined: Tue May 26, 2009 11:51 am

Re: How to Import Checkbox fields

Postby Brian_Houghton » Sun Dec 02, 2012 10:35 am

If I remember correctly 1 will set the checkbox and 0 will leave it unchecked.
Not sure when this change was made, but in my last testing of this feature it seems this was the case.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2248
Joined: Wed May 20, 2009 8:30 am

Re: How to Import Checkbox fields

Postby guptapranjal2319 » Fri Nov 08, 2019 2:21 am

Great Post. Thanks for this valuable information.
guptapranjal2319
 
Posts: 1
Joined: Fri Nov 08, 2019 2:17 am


Return to HanDBase for Palm OS

Who is online

Users browsing this forum: No registered users and 0 guests

cron