Difference between revisions of "Dataform Import Export"

Jump to: navigation, search
Line 1: Line 1:
 
{{Dataform}}
 
{{Dataform}}
 
{{Dataform Docs Note 1}}
 
{{Dataform Docs Note 1}}
 
 
You can import entries into the Dataform from entries data in CSV format. CSV means Comma-Separated-Values and is a common format for text interchange.
 
You can import entries into the Dataform from entries data in CSV format. CSV means Comma-Separated-Values and is a common format for text interchange.
 
 
==Import from CSV==
 
==Import from CSV==
[[Image:df-view-import.png]]
 
 
 
The expected file format is a plain text file with a list of field names as the first record. The data then follows, one record per line.
 
The expected file format is a plain text file with a list of field names as the first record. The data then follows, one record per line.
 
 
The field delimiter defaults to a comma character and the field enclosure is not set by default (field enclosures are characters that surround each field in each record).
 
The field delimiter defaults to a comma character and the field enclosure is not set by default (field enclosures are characters that surround each field in each record).
 
 
The CSV records should be delimited by new lines (usually generated by pressing RETURN or ENTER in your text editor). Tabs can be specified using \t and newlines by \n.
 
The CSV records should be delimited by new lines (usually generated by pressing RETURN or ENTER in your text editor). Tabs can be specified using \t and newlines by \n.
  
Line 30: Line 24:
  
 
To export the displayed entries in the export view, click on the Export pushbutton. You will usually have the option of either opening or saving the file.
 
To export the displayed entries in the export view, click on the Export pushbutton. You will usually have the option of either opening or saving the file.
 
 
==Export to portfolios==
 
==Export to portfolios==
 
Exporting Dataform entries requires Moodle Download Portfolio enabled by site admin. Then, the ##export## may be added to a view designated for export and allow exporting entries to a downloadable file.
 
Exporting Dataform entries requires Moodle Download Portfolio enabled by site admin. Then, the ##export## may be added to a view designated for export and allow exporting entries to a downloadable file.

Revision as of 17:44, 25 January 2014


You can import entries into the Dataform from entries data in CSV format. CSV means Comma-Separated-Values and is a common format for text interchange.

Import from CSV

The expected file format is a plain text file with a list of field names as the first record. The data then follows, one record per line. The field delimiter defaults to a comma character and the field enclosure is not set by default (field enclosures are characters that surround each field in each record). The CSV records should be delimited by new lines (usually generated by pressing RETURN or ENTER in your text editor). Tabs can be specified using \t and newlines by \n.

Sample file:

 name,height,weight
 Kai,180cm,80kg
 Kim,170cm,60kg
 Koo,190cm,20kg

Note: Certain field types may not be supported.

Do not put spaces after your commas or upload will fail!

Export to CSV

When using the CSV format, the user can select either the comma, semicolon, or tab to separate the fields. The selection of the proper character is important. If users select to use a comma to separate the fields and some of the fields contain data with commas then the number of columns is going to be misaligned and likely cause confusion.

The content to export is determined by the field tags you include in the view template. The subset of entries export can be controlled by applying available filters to the export view.

To export the displayed entries in the export view, click on the Export pushbutton. You will usually have the option of either opening or saving the file.

Export to portfolios

Exporting Dataform entries requires Moodle Download Portfolio enabled by site admin. Then, the ##export## may be added to a view designated for export and allow exporting entries to a downloadable file.