Export
- 4 Minutes to read
- Print
- DarkLight
- PDF
Export
- 4 Minutes to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Exports data into a file.
Key | Value(s) | Description |
---|---|---|
method | "Export" | Exports data into file |
all | true/false | Optional. Default = false. If true, all fields in the table will be exported. NOTE: cannot be used at the same time as fields[], template or exportTemplate |
asynchUpload | ||
audit | true/false | Added in v 5.7.18 Optional. Default = false. If true, creates an audit penetration file of exported data. Only works with fields[] option - will be ignored if using "all" Audit processing time Be aware of the additional processing time required when adding an audit to an export, particularly on wide tables. |
createImportScript | true/false | Optional. Default = false. If true, a CreateTableFromFile method is added to file [exportFileName].json |
dataset {} | {} | Required. Determines the data to export. The simplest form of a dataset will be for all records in a table:
Note: It is not recommended to edit dataset JSON by hand - instead, drag a dataset from the Project Explorer or HotBar and drop on the Export method's JSON window. |
delimiter |
| Optional. Default = Comma The following delimiters are supported:
|
eid | "stringID" | an optional id string assigned by the calling application and stored in the export log entry |
exportAlternateFields | true/false | Optional. Default = false If true, fields in the export list that have been decoded (and therefore have an underlying source field) will export the source data rather than the decoded data. For example, rather than exporting "California", the source value of "CA" will be exported. NOTE: exportAlternateFields only takes effect if the project has been configured to export source fields using SetProjectProperties |
exportFileName | Required. The name of the file to output.
| |
exportHeaders | true/false | Default = false. If true, first row of generated file will contain header data: |
exportTemplate | ||
fields[] | [ "table1.field1" "table1.field2" "..." ] | Optional. List of fields to export.
|
infoAudit | true/false | Default = false. If true, an info audit file will be created. |
overwrite | true/false | Default = false. If true, file will be overwritten if it exists. |
quotedStringExport | true/false | Default = false. If true strings will be will be in quotes. |
start | 0 | Optional. Default = 0 Determines the URN number of the first line to output. |
template | "Template_name" | Optional. Default = "" Name of field template that contains the fields to export. Use instead of "all", "fields" and "exportTemplate".
|
upload | ||
urns | true/false | Default = false. If true, urn will be included. NOTE: This only works with "fields" - it does not work with "all" |
project |
Output Files
The following output files may/will be created:
- Data File - always created [exportFileName]
- Export Summary report - always created [exportFileName].info.json
- Audit Spreadsheet - generated if audit=true [exportFileName].xlsx
- Info Audit report - extended version of export summary report, generated if infoAudit = true [exportFileName].info.json
- Load Script - generated if createImportScript is true [exportFileName].json
Examples
Blank Method
{
"method": "Export",
"project": "",
"exportAlternateFields": false,
"urns": false,
"exportHeaders": false,
"quotedStringExport": false,
"createImportScript": false,
"exportFilename": "",
"eid": "",
"delimiter": "Tab",
"fields": [],
"all": false,
"exportTemplate": "",
"template": "",
"audit": false,
"dataSet": {},
"overwrite": false,
"start": 0,
"upload": false,
"asyncUpload": false,
"infoAudit": false
}
Example method
{
"method": "Export",
"exportHeaders": false,
"urns": false,
"quotedStringHeaders": false,
"overwrite": true,
"eid": "60ada34aef4fbbe9c771946a",
"tabDelimited": true,
"createImportScript": false,
"fields": [
"%MODEL%%STABLE%TEMP.%XFIELD%",
"%MODEL%%STABLE%TEMP.%YFIELD%"
],
"dataSet": {
"logic": "or",
"name": "SubSet",
"strict": true,
"set": [
{
"logic": "or",
"stype": "TABLE",
"entity": "%MODEL%%STABLE%TEMP"
}
]
},
"exportFilename": "%DATAPATH%%XFIELD%_%YFIELD%%DSTAMP%.txt",
"project": "Demonstration"
}
Export Summary report
Exporting to file will automatically generate an export summary file:
Example Audit Report
The Audit report is an excel file that summarizes the data that has been export in 2 forms:
- Fields - summary data for each exported field
- Penetration - value counts for each discrete field.
Control audit file output using the "audit" option
See also:
- Data Audit
- Audit method
Example Info Audit Report
The info audit report is a summary report with additional information concerning atomic fields:
- atomicDatasetFields - atomic fields used in generating the dataset.
- atomicFieldDetail - atomic fields used in generating the output fields.
Control Info Audit using the infoAudit option.
{
"records": 66,
"length": 3563,
"filename": "MyTestFile_infoaudit.txt",
"atomicExportFields": [
"01_KJV_BOOK_SUMMARY.BookTestament",
"01_KJV_BOOK_SUMMARY.BookOrdinal",
"01_KJV_BOOK_SUMMARY.BookTitle"
],
"infoFilename": "d:/.../dj-localhost/output/MyTestFile_infoaudit.txt_20250107115315.info.json",
"resolvedFilename": "d:/.../dj-localhost/output/MyTestFile_infoaudit.txt",
"atomicDatasetFields": [],
"user": "aaa@company.com",
"realm": "dj-localhost",
"dateCreated": "2025-01-07 11:53:15",
"host": "NAME",
"atomicFieldDetail": [
{
"field": "01_KJV_BOOK_SUMMARY.BookTestament",
"notnull": 66
},
{
"field": "01_KJV_BOOK_SUMMARY.BookOrdinal",
"notnull": 66
},
{
"field": "01_KJV_BOOK_SUMMARY.BookTitle",
"notnull": 66
}
],
"request": {
"method": "Export",
"exportAlternateFields": false,
"urns": false,
"exportHeaders": false,
"quotedStringExport": true,
"createImportScript": true,
"eid": "",
"audit": true,
"overwrite": false,
"start": 0,
"upload": false,
"asyncUpload": false,
"infoAudit": true,
"all": true,
"dataSet": {
"logic": "or",
"name": "01_KJV_BOOK_SUMMARY",
"strict": true,
"set": [
{
"logic": "or",
"stype": "TABLE",
"entity": "01_KJV_BOOK_SUMMARY"
}
]
},
"project": "BibleProject2",
"exportFilename": "d:/datajet/dj-localhost/output/MyTestFile_infoaudit.txt",
"fields": [
"01_KJV_BOOK_SUMMARY.BookTestament",
"01_KJV_BOOK_SUMMARY.BookOrdinal",
"01_KJV_BOOK_SUMMARY.BookTitle"
]
}
}
Example load script
Generated if createImportScript is true:
Error messages
Error | Possible Cause(s) |
---|---|
request must contain only one of 'fields', 'all', 'template' or 'exportTemplate' | too many properties have been included in the call - keep one, and remove the others. |
a file with that name already exists | provide a different value for exportFilename or set overwrite to true. |
no fields selected for export | provide one of the following: fields, all, template, exportTemplate |
ambiguous field name [] is not a field | make sure "fields" contains fully qualified field names, including the table. |
export template not found | "template" or "exportTemplate" points to an invalid field template. |
cannot open file for writing | invalid path specified for exportFileName |
Was this article helpful?