ftos.data.importFile
IMPORTANT!
Starting with v24.3.0, this is renamed from startImport to ftos.data.importFile.
Starting with v24.3.0, this is renamed from startImport to ftos.data.importFile.
Imports entity data from an Excel file (based on a data import template).
This is a data service method for business service components.
Syntax
Copy
function ftos.data.importFile(dataImportId : string, dataImportItemId : string, importedFile : string, defaultInsertValues : any): void;
| Parameter | Type | Description |
|---|---|---|
dataImportId
|
string | ID of the data import template. |
dataImportItemId
|
string | ID of a data import item from the data import template. |
importedFile
|
string | JSON string containing information about the imported Excel file from the data import item in the following format: Copy NOTE The JSON object described above must be stringified when used as a parameter in the ftos.data.importFile function. |
defaultInsertValues
|
any | JSON object containing default values for attributes missing from the import file. |
Example
In this example:
- We import a data set based on the b0812d39-c264-4815-8f3d-6086e0a0a877 data import template.
- The data import item has the 847ea8fa-e60c-494b-b754-15561803e0d9 ID.
- The imported file is called clientsImport.xlsx and has the clientsImport_590c0175-f754-472a-9c44-c1da9c7afc77.xlsx real name.
- No default values are set for missing attributes {}.
Copy
ftos.data.importFile('b0812d39-c264-4815-8f3d-6086e0a0a877', '847ea8fa-e60c-494b-b754-15561803e0d9', JSON.stringify([{"Name":"clientsImport.xlsx", "RealName":"clientsImport_590c0175-f754-472a-9c44-c1da9c7afc77.xlsx"}]), {});