Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Need help importing checkbox fields

Quote Reply
Need help importing checkbox fields
Anyone know how to import checkbox fields?

I've placed a \n after each checkbox value but they don't come in right.
the checkbox field content looks like this:
No Negative\nFlashes\nGrainy\nSlight Scratches\nSlight Dirt\nSoft

I took a close look at the storage of the data through mysqlman and there's a very subtle difference.

Here's a sample of how links stores the data:
<INPUT TYPE="text" NAME="*insert*_Notes" VALUE="No Negative<return character here>
Flashes<return character here>
Grainy<return character here>
Slight Scratches<return character here>
Slight Dirt<return character here>
Soft" SIZE="30" tabindex="30">

Here's what happened when I used \n during import

<INPUT TYPE="text" NAME="*insert*_Notes" VALUE="No Negative
<return character here>Flashes
<return character here>Grainy
<return character here>Slight Scratches
<return character here>Slight Dirt
<return character here>Soft" SIZE="30" tabindex="30">

Is there a different character I should use? I've also tried using the html break tag, as well as \r but they don't even come close. It looks like the system is looking for a return and then replaces it with a break tag for output.

Any ideas?

Peace.

Quote Reply
Re: Need help importing checkbox fields In reply to
agggh,

In an attempt to find out what character to use when importing checkbox field data, I decided to go in the reverse direction and create a record and add the appropriate checkbox values. Then I exported the data to see how the system wants to handle this data. When I look at the exported file (it imports fine) I found that there "appears" to be just a space between each checkbox value. I downloaded the file and tried to open it in Hotdog, BUT the contents of the file after the first checkbox are all missing, clearly indicating this is not a space. I can open the file and see all the data using the WSFTP editor, but the characters are just spaces. If I don't make any changes or resave the file, I can import it again without a problem, but if I save the file, then those values don't come through.

Please help, is there a character I need to use.

I can't go any further until I get this working. It would seem like a good idea, if the development of this program included the use of checkboxes so these bugs wouldn't come up when the new versions are released. This problem also occurred in Linksql1.x

Quote Reply
Re: Need help importing checkbox fields In reply to
Hi,

The problem is 1.x never really support checkbox/multiple select's very well. We have built this into 2.0, but it is stored different as you found out. The import doesn't take it into consideration as there are very few people using it. =)

What you want to do is:

1. Add your custom field in and make the form type checkbox, and set the names/values to what you want stored/displayed.
2. Import the old data.
3. From the SQL monitor run:
UPDATE Links SET checkboxcolumn = REPLACE(checkboxcolumn, "\n", "\0")

and that should do it. The values are now separated by a \0 (null char).

Let me know if it doesn't work out and I can take a look.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Need help importing checkbox fields In reply to
Thank you so much Alex,

I was able to incorporate the \0 (null char) into my checkbox fields in my excel file and import with no problem.

Peace.