Describe the Source CSV Data
Workday Studio's
PrismAnalytics
component requires a description of the
source CSV data. You can create the JSON text in the tool of your choice and use it
in Studio later. Example: paste it into a text message on the Message
Builder
tab of a write
step.- Create JSON text containing 2 main nodes:
- parseOptions: information about the format of the CSV data, including the character set and the delimiter character.
- fields: information about each field in the CSV data, including data type and formatting.
- In theparseOptionsnode, you can define these fields:Field NameTypeRequiredDescriptioncharsetNameObjectYesThe CSV data file's character set. Example:"charset": { "id": "Encoding=UTF-8" }Currently, Workday supports the UTF-8 encoding format only. Workday ultimately stores the data in Unicode format. Characters with no Unicode equivalent are stored as the Unicode replacement character, a question mark on a black diamond background.fieldsEnclosedByStringNoThe character used to enclose fields in the CSV data. The default is double quote marks. If a double quote mark is used within a field, escape it by preceding it with another double quote mark. Example:"fieldsEnclosedBy": "\""fieldsDelimitedByStringYesThe character used to separate field values in the CSV data. Example:"fieldsDelimitedBy": ","headerLinesToIgnoreNumberNoThe number of lines for the parser to ignore as a header. Set to0if the CSV data doesn't have a header. Example:"headerLinesToIgnore": 1typeObjectYesThe input file's type. Currently, Workday supports delimited files only. Example:"type": { "id": "Schema_File_Type=Delimited" }This value is case-sensitive. Note the upper-case D in Delimited.
- In thefieldsnode, you can define these fields:Field NameTypeRequiredDescriptionordinalNumberYesThe order of the field in the CSV dataset (index). The ordinal values:
- Must start with 1.
- Must be contiguous.
- Can't skip any number.
- Have a maximum of 1000.
nameStringYesThe name of the CSV dataset field. Field names:- Must be unique in the dataset.
- Can contain up to 255 characters.
- Can only include alphanumeric and underscore characters.
- Must start with a letter.
- Can't end with an underscore character.
- Can't begin with WPA_.
descriptionStringNoThe field's description. Maximum 1000 characters. Example:"description": "The worker's full name."typeObjectYesThe field's type. Options are:- Text
- Numeric
- Boolean
- Date
"type": { "id":"Schema_Field_Type=Date"}parseFormatStringYes (for Date types)The date's format. Example:"parseFormat": "dd-MM-yy HH24:mm:ss"precisionNumberYes (for Numeric types)The maximum number of digits in a numeric value. Includes all numbers to the left and right of a decimal point but not the decimal point itself. Maximum value is 38. Example:"precision": 38scaleNumberYes (for Numeric types)The number of digits to the right of the decimal point in a numeric value. Must be less than theprecisionvalue. Example:"scale": 2defaultValueTextNoThe default value for a field, if none is provided in the upload file.Express a default text value in double quotes. Example:“N/A”.Default date values must be in this format: yyyy-MM-dd'T'HH:mm:ss'Z'.Default numeric values must agree with the specifiedprecisionandscale.requiredBooleanNoSpecifies whether a field must contain a value. Set toTrueif a field is required, otherwise set toFalse. If a field is required, its value can't be null in any insert, update, and upsert data operation.externalIDBooleanYes (to take advantage of update, upsert, and delete operations).Specifies whether a field represents an External ID. Set toTrueto designate a field an External ID, otherwise set toFalse.Because External ID fields can't be null, you should specify that any External ID field is required. You can only specify 1 field as External ID.Specify an External ID in new tables if you want to take advantage of update, upsert, and delete functionality.To use update, upsert, and delete functionality with an existing table, you must modify it so it has a single field designated as External ID. The Prism public API doesn't support the modification of a table that contains data. In such cases, make the modification in Workday.
Your source CSV file describes this table:
Employee | Employee ID | Job Title | Hire Date | Annual Salary |
|---|---|---|---|---|
Logan McNeil | 21001 | Vice President, Human Resources | 1/1/2010 | 213298.00 |
Oliver Reynolds | 21003 | Chief Information Officer | 1/1/2010 | 394935.00 |
Maximilian Schneider | 21004 | Chief Operating Officer | 1/1/2010 | 255373.00 |
Teresa Serrano | 21005 | Controller | 1/1/2010 | 291785.00 |
You describe it using JSON like
this:
{ "parseOptions": { "fieldsDelimitedBy": ",", "fieldsEnclosedBy": "\"", "headerLinesToIgnore": 1, "charset": { "id": "Encoding=UTF-8" }, "type": { "id": "Schema_File_Type=Delimited" } }, "fields": [ { "ordinal": 1, "name": "Employee", "description": "Employee", "precision": 255, "scale": 0, "parseFormat": null, "type": { "id": "Schema_Field_Type=Text" } }, { "ordinal": 2, "name": "Employee_ID", "description": "Employee ID", "precision": 38, "scale": 0, "parseFormat": null, "type": { "id": "Schema_Field_Type=Numeric" } }, { "ordinal": 3, "name": "Job_Title", "description": "Job Title", "precision": 255, "scale": 0, "parseFormat": null, "type": { "id": "Schema_Field_Type=Text" } }, { "ordinal": 4, "name": "Hire_Date", "description": "Hire Date", "precision": 0, "scale": 0, "parseFormat": "MM/dd/yy", "type": { "id": "Schema_Field_Type=Date" } }, { "ordinal": 5, "name": "Annual_Salary", "description": "Annual Salary", "precision": 38, "scale": 2, "type": { "id": "Schema_Field_Type=Numeric" } } ], "schemaVersion": { "id": "Schema_Version=1.0" } }