Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListInformation: Steps to import CSV data to without losing Existing Field DefinitionsInformation: Steps to import CSV data to without losing Existing Field Definitions
Previous
 
Next
New Post
6/22/2011 11:20 AM
 
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.
  1. Exporting your existing FnL (XML).  This will give you a snapshot of your field information. Keep a backup.
  2. You will likely wish to export a CSV of your existing FnL to determine the proper right CSV format.  Keep a backup.
  3. 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. 
  4. Export your newly updated FnL data (XML) Keep a backup.
  5. 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
  6. 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>
 
New Post
11/22/2017 4:20 PM
 
After 8 years this is still a good suggestion, thank you Lawrence ! I don't know if it's a good sign that your tip still applies on the latest version of the Form and List module :-(
 
New Post
11/22/2017 4:32 PM
 
please report the issue into the issue tracker of the project at https://github.com/DNNCommunity/DNN.F...

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListInformation: Steps to import CSV data to without losing Existing Field DefinitionsInformation: Steps to import CSV data to without losing Existing Field Definitions


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out