Use this resource to export data to CSV or JSON format. You can export code values in a code list, value mappings in a crosswalk, or relationships in a hierarchy.
Export code values to a CSV file
Exports the code values in a code list to a CSV file.
POST request
To export code values in a code list, submit a POST request with the following URI:
/rdm-service/external/v2/export
Note: In the request header, you must specify the Accept attribute to application/octet-stream.
Use the following parameters in the request body to specify the code list to export:
Field
Type
Description
delimiter
String
Delimiter used to separate values. Value must be ASTERISK, CIRCUMFLEX, COLON, COMMA, PIPE, SECTION, SEMICOLON, SPACE, or TAB.
codepage
String
Code page used for the export file. Value must be UTF8.
decimalSeparator
String
Decimal separator used for numbers. Value must be COMMA or DOT.
thousandSeparator
String
Grouping separator used for numbers. Value must be COMMA, DOT, SPACE, SINGLEQUOTE, or NONE.
dateFormat
String
Format used for dates. Use one of the following formats:
- DE. For dd.mm.yyyy format.
- ISO. For yyyy-mm-dd format.
- US_HYPHEN. For mm-dd-yyyy format.
- US_SLASH. For mm/dd/yyyy format.
filename
String
File name for the exported file. Value must end with the .csv file extension.
containerType
String
Type of asset that contains code values. Value must be codelist.
containerId
String
The ID of the code list.
Note: You can find the ID of assets in Reference 360 or use REST APIs to retrieve the IDs. For more information, see Asset IDs.
filter
Object
Optional. Filter criteria for exporting filtered code values. For more information, see Filter criteria.
columns
Array
Optional. Attribute columns you want to export. If you don't specify attribute columns, the export includes all attribute columns.
fieldName
String
Optional. Name of attribute column to include in the exported file.
excludeParentId
Boolean
Optional. Indicates whether to include the parent ID of code values in the CSV file. Value is true or false.
POST response
The response is a CSV file. The CSV file contains two header rows followed by data rows.
The CSV file contains the following columns: status.key and effectiveDate. Based on your data model, you might have additional columns in the file.
POST example
To export the code values in a code list, you might use the following request:
POST https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v2/export HTTP/1.1 Content-Type: application/json Accept: application/octet-stream IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX
The following sample response shows the exported data in JSON format:
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: 1114
{ "content":[ { "Code":"root1", "children":[ { "Code":"child1_1", "codeListId":"Id of Child 1", "codeListName":"Name of Child 1", "fields":{ "Name":"Name of child 1.1", "Code":"child1_1" } }, { "Code":"child1_2", "codeListId":"Id of Child 1", "codeListName":"Name of Child 1", "fields":{ "Name":"Name of child 1.2", "Code":"child1_2" } } ], "fields":{ "Name":"Name of root 1", "Code":"root1" } }, { "Code":"root2", "children":[ { "Code":"child2_1", "codeListId":"Id of Child 2", "codeListName":"Name of Child 2", "fields":{ "Name":"Name of child 2.1", "Code":"child2_1" } }, { "Code":"child2_2", "codeListId":"Id of Child 2", "codeListName":"Name of Child 2", "fields":{ "Name":"Name of child 2.2", "Code":"child2_2" } } ], "fields":{ "Name":"Name of root 2", "Code":"root2" } } ] }
Filter criteria
You can filter code values in a code list and export the results.
You can filter values for the code attribute or the attributes that are configured as display attributes. For example, you can filter values for the code attribute with 001.
Supported filter operators and filter values for fields
The filter operators depend on the field type of the attribute.
The following table describes the filter operators that you can use for each field type:
Field Type
Supported Filter Operators
Filter Values
Boolean
_equals
_notEquals
_isEmpty
Boolean
Decimal or Integer
_equals
_notEquals
_isEmpty
_greaterThan
_greaterThanEquals
_lessThan
_lessThanEquals
Number
String
_equals
_notEquals
_isEmpty
_startsWith
_endsWith
_contains
_doesNotContain
Text
Date
_equals
_notEquals
_isEmpty
_from>
_to
_range
ISO 8601 date
For example, 2019-12-24.
DateTime
_equals
_notEquals
_isEmpty
_from
_to
_range
ISO 8601 date and time
For example, 2019-12-15T14:17:04Z.
Reference Data
_equals
_notEquals
_isEmpty
_in
Values in the Code attribute or values in the display attributes for the reference data.
Filter examples
To filter assets with fields that are equal to NY, you can use the following filter operator:
{ "state":{ "_equals":"NY" } }
To filter assets with fields that are not equal to NY, you can use the following filter operator:
{ "state":{ "_notEquals:":"NY" } }
To filter assets with numeric fields that are greater than 68, you can use the following filter operator:
{ "age":{ "_greaterThan":68 } }
To filter assets with numeric fields that are greater than or equal to 68, you can use the following filter operator:
{ "age":{ "_greaterThanEquals":68 } }
To filter assets with numeric fields that are less than 68, you can use the following filter operator:
{ "age":{ "_lessThan":68 } }
To filter assets with numeric fields that are less than or equal to 68, you can use the following filter operator:
{ "age":{ "_lessThanEquals":68 } }
To filter assets with fields that match any of the specified values, you can use the following filter operator:
{ "state":{ "_in":[ "NY", "CA" ] } }
To use multiple field operators, you can use the _and or _or operators.
To filter assets with fields that match all the specified values, you can use the following filter operator:
{ "_and":[ { "state":"CA" }, { "age":68 } ] }
To filter assets with fields that match at least one of the specified values, you can use the following filter operator:
{ "_or":[ { "state":"CA" }, { "age":68 } ] }
When you use a comma in the code, the comma acts like an _and operator. For example, the following code filters the state "NY" and people of age "68":