This information is intended for non-programmers who are a little more adventurous. Programmers will likely laugh and say "duh-uh" as I have added in a lot of steps that would be immediately obvious to them once they understood the problem space. For those of us who like to solve problems but are not developers, I would have loved to have this info instead of having to figure it out myself.
Background
CSV import provides an excellent way to get data into an existing FnL however people have noticed that even if you export and re-import the exact same CSV, all existing fields are reset to type: Text. Hopefully this issue will be changed in future release however below is the process I used to work around this issue.
Workaround
NB: you will wish to make backups of all the files you export before you modify them in case things go south ;-) Nobody ever looked stupid for backing up too much.
- Exporting your existing FnL (XML). This will give you a snapshot of your field information. Keep a backup.
- You will likely wish to export a CSV of your existing FnL to determine the proper right CSV format. Keep a backup.
- Create and import the new/updated CSV data. Your CSV could have been made from scratch, from an outside data store, or from a modification of a CSV export from your FnL.
- Export your newly updated FnL data (XML) Keep a backup.
- From the XML in step #1 copy over the field information to the XML file from step #4 and create a new XML file. See "Note about copying field data" below
- Importing the new XML file from #5 which contains the updated field information. You are done.
Issues This Does Not Resolve
While this "mostly" works around the issue I've noticed an issue with URL fields that you have set to "open in new window". Those flags are set in the value of the field (data) itself which is lost upon the CSV import/export and not stored in the XML field information (is stored in the XML data values). Given that I use this flag globally (i.e. I want all the URL's to open in the new window) I can do a find replaqce on the XML file for URL's and add the switch into the values. This would however pose a more complicated problem for someone who had a mix of URLs where some opened in new window and some not. Hiopefully they figurte out how to retain that switch in the CSV in the future when is is exported from FNL as opposed to just losing it.
If anyone comes across any additional issues let me know. If anyone actually uses this work around and wishes that it didn't need to exist. Please add your comments to
http://dnnfnl.codeplex.com/workitem/1...
Note about copying field data
For anyone who doesn't know, when you edit the XML in a text editor, all the "Data" is enclosed in tags(<Data></Data>) and all the field information is enclosed in separate tags (<Fields></Fields>), and so forth for "Settings". When I say to replace the field data I mean find the first opening field tag (<Field> and copy it and everything that follows until; the very last field closing tag (</field>). There will be one pair of tags for every field/column in your table. The field tags directly follow all the data tags and immediately precede the settings tags. If you have a lot of data they will be very far down in the file. You may wish to start from the bottom up.
Here is a sample of what a single field looks like enclosed in tags, you will be copying and replacing all of these fields in one go (i.e. the text you are replacing may be 10 or 20 times longer than this depending on the number of fields.
Sample of a single field:
<Fields>
<UserDefinedFieldId>184</UserDefinedFieldId>
<ModuleID>546</ModuleID>
<FieldTitle>Mobile/Phone 2 (Alt. Contact)</FieldTitle>
<Required>false</Required>
<FieldOrder>18</FieldOrder>
<FieldType>String</FieldType>
<Visible>false</Visible>
<ShowOnEdit>true</ShowOnEdit>
<Searchable>false</Searchable>
<PrivateField>false</PrivateField>
<NormalizeFlag>false</NormalizeFlag>
<ValueColumn>Mobile_x002F_Phone_x0020_2_x0020__x0028_Alt._x0020_Contact_x0029_</ValueColumn>
<SortColumn>Mobile_x002F_Phone_x0020_2_x0020__x0028_Alt._x0020_Contact_x0029_</SortColumn>
</Fields>