Can I add a static field to an export template?

SOLVED

Hi guys,

I am trying to build an export to CSV that we can upload to the bank on a daily basis.  I'm nearly there, I'm creating a 'flat' format export, and it's all looking good, though the bank requires one of the fields to be a single character that never changes. This field doesn't exist in X3. Can I add this to the export template easily, or do I need to do something clever?

Thanks in advance for your help.

Jim

  • +1
    verified answer

    Hello,

    If you look at the online help( if you are on V7 or higher) you have below.

    • Field (field FLD)

    It is used to indicate the name of the field of the table to be imported or exported. Different syntaxes are possible here in order to define the information to be extracted or integrated :

    • The character / (slash) means that a group indicator is written upon export or searched for during import. In a template used for the import, when several groups exist, this separator is mandatory for each group. The group separator is supposed to be a normal field (enclosed by field separators and delimiters if the template type Delimited is used).
    • The most simple syntax is FIELD(index), when a field coming from the table declared in the previous column is imported or exported. A selection window is used to display the possible fields.
    • If a constant string of characters enclosed between double-quotes ( " ) is entered here, the field will be written as it is in the file to be exported and ignored in the import.
    • If nothing is entered, it means that there will be an empty field in the exported file (enclosed by field delimiters if the template is of the type Delimited). In import mode, it means that the corresponding field must be ignored.
    • The syntax *N, where N is a number between 1 and 99, is also possible. This can be used to assign (in import) or to read (in export) the GIMP(N) variable. GIMP is a global variable, of the character string type, with a maximum length equal to 100, that must be assigned in a specific/custom process associated with the import or export.
    • The last possibility, only used in export, consists in defining any calculated expression preceded with the sign equal ( = ). This expression, which can call constants, functions, variables, operators and fields coming from on-line tables, is syntaxically verified upon entry (the control of the context, in particular the fact that the variables exist, cannot obviously be verified).
  • 0 in reply to Esfahani

    Great,  Smashed it!

    Just added the static field in "'s in the field name, and it's come out exactly as I wanted.  Many thanks.

    Jim,

  • 0 in reply to VindalooJim

    Hi Jim, Esfahani,

    Been reading this help article and continue to scratch my head, for example....

    Have the below line within a field for an import export template

    L;SORDERP;SAU

    How do I hardcode it for the SAU to be EA?

    Thanks, 

  • 0 in reply to Pablo ES
    SUGGESTED

    In FLD write "EA" instead of choosing a field STU

  • 0 in reply to G@G

    How do I then map "EA" to correspond STU?

    Thanks, 

  • 0 in reply to Pablo ES
    SUGGESTED

    Sorry, missed that you are talking about import template as topic was about export template.

    One of the possible solutions is to use transcoding of import data, you can read more about this here on online help center.