Skip to content

Commit

Permalink
Merge pull request #204 from flotiq/fix/23583-correct-excel-migrator-…
Browse files Browse the repository at this point in the history
…page

Fix #23583 correct excel migrator page
  • Loading branch information
MaciejLabedzkiCodewave authored Dec 21, 2023
2 parents c81f6ef + c9fe419 commit 95ad961
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions docs/CLI/excel-data-migration.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
title: Flotiq - MSExcel Migration | Flotiq docs
description: How to migrate Flotiq data to/from MS Excel file

`flotiq excel-export` and `flotiq excel-import` are Flotiq CLI commands for migrating data to and from MS Excel file. If you wish to use our Flotiq - Excel migrator directly, you can use our [flotiq-excel-migrator](https://www.npmjs.com/package/flotiq-excel-migrator){:target="_blank"} npm package.
# Migrating data between Flotiq and MS Excel

# Export
You can migrate your data between Flotiq and MS Excel with Flotiq CLI. To migrate your data you need a Flotiq account (you can [register here](http://editor.flotiq.com/register.html)) and your "Read Only API Key" or "Read and write API key", depending on whether you want to import or export your data (more about API keys [here](../API/index.md)).

`flotiq excel-export` command will export Content Objects from the given Content Type to an MS Excel file in .xlsx format.
If you wish to use our Flotiq - Excel migrator directly, you can use our [flotiq-excel-migrator](https://www.npmjs.com/package/flotiq-excel-migrator){:target="_blank"} npm package.

## Export Flotiq data to MS Excel

## Usage
`flotiq excel-export` command will export Content Objects from the given Content Type to an MS Excel file in .xlsx format.

The command looks like this:

Expand All @@ -28,37 +30,35 @@ Command logs the following information:
!!! note
`Max string length` for all values is set to 30.000 because MS Excel has trouble handling text with length > 30 000 in one cell.

## Parameters
### Export parameters

`ctdName` - API name of Content Type Definition you wish to export,

`filePath` - the directory to which the xlsx file is to be saved. Type in "." if you want to save the file inside the current directory,
`filePath` - the directory to which the .xlsx file is to be saved. Type in "." if you want to save the file inside the current directory,

`flotiqApiKey` - API key to your Flotiq account with read permission.

## Flags
### Export flags

`--limit=[number]` or `--l=[number]` - number of Content Objects to export counting from the top row, default: 10.000,

`--hideResults` or `--hr` - information about the export process will not appear in the console.

## Result example

```
{
directoryPath: '[_dirname]//test.xlsx',
errors: null,
coTotal: 3,
co_success: 3
}
```
!!! Responses
When successful:
```
{
directoryPath: '[_dirname]//test.xlsx',
errors: null,
coTotal: 3,
co_success: 3
}
```

# Import
## Import data from MS Excel to Flotiq

`flotiq excel-import` command will import Content Objects from an MS Excel file to the given Content Type.

## Usage

The command looks like this:

```bash
Expand All @@ -72,15 +72,15 @@ For every sheet in the workbook:
* Number of errors in Content Object import
* errors data (object)

## Parameters
### Import Parameters

`ctdName` - API name of Content Type Definition you wish to import data to,

`filePath` - the directory to the xlsx file you wish to import data from,
`filePath` - the directory to the .xlsx file you wish to import data from,

`flotiqApiKey` - API key to your Flotiq account with read and write permissions.

## Flags
### Import Flags

`--limit=[number]` or `--l=[number]` - number of Content Objects imported counting from the top row, default: 10 000,

Expand All @@ -90,7 +90,24 @@ For every sheet in the workbook:

`--hideResults` or `--hr` - information about the import process will not appear in the console.

## Notes
!!! Responses
When successful:
```
{
Sheet1: {
sheetImportedCoCount: 98,
sheetErrorsCount: 2,
sheetErrors: [ [Object] ]
}
Sheet2: {
sheetImportedCoCount: 100,
sheetErrorsCount: 0,
sheetErrors: []
}
}
```

### Notes

* valid XLSX file looks just like the one that exportXlsx saves. The first row on the sheet (header) should have the names of CTD's properties. Every following row is a separate Content Object, for example:

Expand All @@ -102,24 +119,7 @@ For every sheet in the workbook:
* importXlsx allows you to import many sheets from the same workbook. However, these sheets must be dedicated to the same CTD and have this CTD's properties in the header.
* Parameter LIMIT limits the number of Content Objects you will import from XLSX works individually for every sheet in the workbook.

## Result example

```
{
Sheet1: {
sheetImportedCoCount: 98,
sheetErrorsCount: 2,
sheetErrors: [ [Object] ]
}
Sheet2: {
sheetImportedCoCount: 100,
sheetErrorsCount: 0,
sheetErrors: []
}
}
```

# Data mapping
## Data mapping

The form in which Flotiq data is exported to / imported from xlsx varies on property type:

Expand Down

0 comments on commit 95ad961

Please sign in to comment.