Dataport - How many field contains the current row imported?

MPIRESMPIRES Member Posts: 3
Hi,

Is it possible to know how many fields contains the current row imported by my dataport?

To explain, I have 59 variables defined in the dataportfields of my dataitem. I would like to get an error message if my CSV file doesn't contains 59 fields.

For example, if it contains 2 fields, the dataport import the 2 fields and set the others to default values. I would like to avoid it. Do you have any idea?

Thx

Comments

  • ccorreiaccorreia Member Posts: 36
    For what i understand with a dataport you allways have to get the 59 fields.
    If you only have 2 or 10 fields and the dataport has the 59 fields you will get an error on the import.
    you however can have only two with values and the others with nothing.
    A structure like:
    "Value1";"Value2";;;;;(x times till 59)
  • matttraxmatttrax Member Posts: 2,309
    If you want to make sure there is a value for every field and not the default value then you'll want to import into text variables, check those values, and then assign your fields to the appropriate text variable.

    A text array can be used to do this more easily. And you'll have to use EVALUATE to convert between text and other data types.
  • MPIRESMPIRES Member Posts: 3
    [
    matttrax wrote:
    If you want to make sure there is a value for every field and not the default value then you'll want to import into text variables, check those values, and then assign your fields to the appropriate text variable.

    A text array can be used to do this more easily. And you'll have to use EVALUATE to convert between text and other data types.

    It's the solution that I use.

    But my customer want to know if the import file is correct, that means i have to check:
    [*]if the file has the good number of colomn (They want a message like this: Your file format is wrong: Missing Columns...)
    [*]if each field has the good type (but they send me blank for a Integer/Decimal = 0 so I have to disable the EVALUATE for Integer,Decimal fields,...)
Sign In or Register to comment.