The TABLE function returns the data from a CSV or Properties file associated with the specified key.
The input is the key to search for in the specified file.
Each record in a CSV file takes the form of "key,value". Each record in a Properties file takes the form of "key=value".
| Input | Data Type | Description |
|---|---|---|
| InputN | String | The key. |
| Output | Data Type | Description |
|---|---|---|
| OutputN | String | The data associated with the specified key. |
| Name | Property Type | Description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Mode | choice | Specifies whether the input table is to the read from a file or to be defined by the InlineTable property.
|
|||||||||||||||||||||
| Type | choice | Specifies the table's format.
|
|||||||||||||||||||||
| HomeDirectory | pathResolver | Specify the base folder of relative path of table file.
|
|||||||||||||||||||||
| FilePath | remoteFile | If Mode=File, this property specifies the file to read the table data from. If the file is specified using a relative path, then the base directory is the project owner's home directory. | |||||||||||||||||||||
| FileEncoding | choice | If Mode=File, this property specifies the table file's character encoding.
|
|||||||||||||||||||||
| InlineTable | string |
If Mode=Inline, this property specifies the table's data. |
|||||||||||||||||||||
| KeyColumn | string |
If Type=CSV, this property specifies which field in the table's records are to be used as the key field. A record's first field is indexed as 1. |
|||||||||||||||||||||
| ValueColumn | string |
If Type=CSV, this property specifies which field in the table's records are to be used as the value field. A record's first field is indexed as 1. |
|||||||||||||||||||||
| IllegalKey | choice | Defines what is to be output if no data exists for the specified key.
|
|||||||||||||||||||||
| DefaultValue | string |
The default value to be output when IllegalKey is set to DefaultValue and no matching key field is found. |
| Property | Output | |||
| Input 1 | D002 | Mode | File | MN345 |
| Type | CSV | |||
| FilePath | ../table.csv | |||
| FileEncoding | (AutoDetect) | |||
| KeyColumn | 1 | |||
| ValueColumn | 2 | |||
| IllegalKey | Key | |||
The ../table.csv file's content used in the example above is listed below:
D001,MN123
D002,MN345
D003,MN567
D004,MN789
| Property | |||||
| Input1 | D002 | Mode | File | Output1 | MN345 |
| Input2 | B | Type | CSV | Output2 | JKL |
| FilePath | ../multitable.csv | ||||
| FileEncoding | (AutoDetect) | ||||
| KeyColumn | 1,2 | ||||
| ValueColumn | 3,4 | ||||
| IllegalKey | Key | ||||
The ../multitable.csv file's content used in the example above is listed below:
D001,A,MN123,ABC
D001,B,MN123,DEF
D002,A,MN345,GHI
D002,B,MN345,JKL
D003,A,MN567,PQR
D003,B,MN567,STU