CSVParse
Description
Parses a CSV string, constructs a value of the set type and sends it through the result
output.
Properties
Specific
-
Input
EXPRESSION (string)
-
CSV string to be parsed.
-
Delimiter
EXPRESSION (string)
-
Defines the character used to delimit fields within a CSV record. The default delimiter is
","
. -
From
EXPRESSION (integer)
-
Defines the starting record to be processed. Counting is 1-based, i.e. for the first record it is necessary to set 1 (not 0).
-
To
EXPRESSION (integer)
-
Defines the last record to be processed. Counting is 1-based, i.e. for the 5th record it is necessary to set 5 (not 4).
General
-
Description
String
-
This is the description of the Action component. Description is displayed below the component in the Project editor/viewer. In the main toolbar, it is possible to hide or display descriptions of all components with one click.
Flow
-
Inputs
Array
-
Additional component inputs that the user can add as desired in order to use them to receive additional data needed when evaluating expressions in properties. Each input is given a name and type. Name is used when referencing an input within an expression. A type is used to project Check to check whether a data line that transmits data of that type is connected to the input or not.
-
Outputs
Array
-
Additional component outputs that the user can add to send data through. Each output is assigned a name and type. An example of using this output is e.g. in the Loop component, where we can put the output name for the
Variable
property instead of e.g. variable name. In that case, the Loop component will not change the content of the variable in each step, but will send the current value through that output. -
Catch error
Boolean
-
If this checkbox is enabled then an
@Error
output will be added to the component and if an error occurs in this component during the execution of the Flow, the Flow will continue through that output. The data that will be passed through that output is the textual description of the error.
Position and size
-
Align and distribute
Any
-
Alignment icons and component distribution. Alignment icons appear when two or more components are selected, and distribution icons appear when three or more components are selected.
Inputs
-
seqin
SEQ | OPTIONAL
-
A standard sequence input.
-
text
DATA(string) | MANDATORY
-
The input through which the CSV string to be parsed is received. This input can be deleted (we delete it in the Flow – Inputs list) if it is not needed, i.e. if we want to parse a string obtained by evaluating an arbitrary expression set through
Input
property.
Outputs
-
seqout
SEQ | OPTIONAL
-
A standard sequence output.
-
result
DATA(any) | MANDATORY
-
Data output to which the constructed value is sent. The type of that value must be specified – this should be done in the Flow – Outputs section:
In the CSV example mentioned below, we have a CSV string that looks like this:
[ { "country": "Afghanistan", "city": "Kabul" }, { "country": "Albania", "city": "Tirana" }, { "country": "Algeria", "city": "Alger" }, ... ]
The constructed value returned by this Action should be of type
array:CountryCity
, whereCountryCity
is a structure that has two fields (the name of the structureCountryCity
is arbitrarily chosen by the developer):country
, whose type isstring
city
, whose type isstring
The definition of that structure looks like this in the Project editor:
Examples
- CSV