2026-02-26 - ImportData CsvImportConfig

From Izara Wiki
Revision as of 11:07, 26 February 2026 by Jammy (talk | contribs) (Created page with "= CsvImportConfig = <syntaxhighlight lang="JavaScript"> { "csvImportConfigId": "xxxxx", "recordDeliminator": "\n", "useUserReference": true, "fieldDeliminator": ",", "escapeString": "\\", "removeFloatingEscapeString": true, "removeWhiteSpace": true, "fieldNames": { "titleRow": 1, "titleRowOpenEnclose": "\"", "titleRowCloseEnclose": "\"", "replacefieldNames": {} }, "ignoreRows": [4,5], "overwriteColumnNam...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CsvImportConfig

{
    "csvImportConfigId": "xxxxx",
    "recordDeliminator": "\n",
    "useUserReference": true,
    "fieldDeliminator": ",",
    "escapeString": "\\",
    "removeFloatingEscapeString": true,
    "removeWhiteSpace": true,
    "fieldNames": {
      "titleRow": 1,
      "titleRowOpenEnclose": "\"",
      "titleRowCloseEnclose": "\"",
      "replacefieldNames": {}
    },
    "ignoreRows": [4,5],
    "overwriteColumnName": {
      "fieldName": "{replaceToValue}"
    },
    "objectTypes": [],
    "floatingRelationships": []
}
  • csvImportConfigId (required) = The ID of the CsvImportConfig
  • recordDelimiter (required) = The row delimiter
  • fieldDelimiter (required) = The column delimiter
  • escapeString (required) = The character used to escape delimiters (e.g., " to indicate that this is a quotation mark, not a column delimiter)
  • removeFloatingEscapeString (required) = Remove any standalone (floating) escape characters
  • removeWhiteSpace (required) = Remove whitespace within the column
  • titleRow (required) = Specify which row (x) of the CSV is the header row
  • ignoreRows (required) = Ignore the specified rows

objectTypes

 "objectTypes": [
      {
        "setObjectTypeFieldNames": {},
        "objType": {
          "serviceTag": "Translations",
          "objectType": "translationLink"
        },
        "searchPattern": "^translationLink.*:",
        "instancePattern": "(?<=translationLink)(.*)(?=:)",
        "fieldNamePatterns": [
          {
            "fieldNamePattern": "(?<=:translationLink-A)",
            "fieldName": "translationLink"
          }
        ],
        "fieldNameSearchPattern": "(?<=:)(.*)",
        "referenceFieldNames": [
          "userRef",
          "ref"
        ],
        "referenceLinks": {
          "linkTagetToTL": {
            "relType": {
              "serviceTag": "Translation",
              "relationshipTag": "hasTranslationLink"
            },
            "direction": "from"
          }
        },
        "defaultActionField": "create",
        "actionField": {
          "fieldName": "actionField",
          "createValue": "c",
          "updateValue": "u",
          "referenceValue": "r"
        },
        "defaultEnclose": {
          "openEnclose": "\"",
          "closeEnclose": "\""
        },
        "enclose": [
          {
            "openEnclose": "\"",
            "closeEnclose": "\"",
            "alwaysEnclose": "always",
            "fieldNames": [
              "weight",
              "textTag",
              "languageId",
              "userRef"
            ]
          }
        ],
        "emptyDataFieldNames": [],
        "overwriteValues": {}
      }
    ]
  • setObjectTypeFieldNames (optional) = Specify the objType for each instancePattern (used when the same searchPattern is shared but the instancePattern differs). For example:
"setObjectTypeFieldNames": {
         "subObjectTypeX": {
           "serviceDeliverySTD1": {
             "serviceTag": "DelivMethodSTD",
             "objectType": "deliveryMethod"
           },
           "rateTable001": {
             "serviceTag": "DeliveryMethodRAT",
             "objectType": "rates"
           }
         }
       }
deliveryDELIVERYSTD:actionField deliveryDELIVERYSTD:subObjectTypeX deliveryRATETABLE:actionField deliveryRATETABLE:subObjectTypeX
c serviceDeliverySTD1 c rateTable001

By defining "searchPattern": "^delivery.*:",

the instancePattern is DELIVERYSTD, the objType will be set accordingly

{
        "serviceTag": "DelivMethodSTD",
        "objectType": "deliveryMethod"
}

the instancePattern is RATETABLE, the objType will be set accordingly.

{
        "serviceTag": "DeliveryMethodRAT",
        "objectType": "rates"
}
  • searchPattern (required) = The system will look for column names that start with the value of searchPattern, followed by :
  • referenceLinks (optional) = Used in the case of a ReferenceLink to specify the targetObject and which Relationship to use
  • instancePattern (required) = Extract the Instance name (e.g., if searchPattern = translationLink, then translationLinkA will extract A as the Instance)
  • referenceFieldNames (required) = The fields used as references
  • actionField (required) = Define the action abbreviation in the CSV (e.g., c = create, u = update, r = reference)
  • defaultActionField (optional) = If no Action is specified, the system will use the Action defined here
  • enclose (required) = The fields specified in fieldNames must be enclosed
  • defaultEnclose (required) = Fields not specified in enclose will use the defaultEnclose value


FloatingRelationShip