How to Create Import Task

Skyvia integration packages can include one or more tasks. Import task imports data from a file, cloud application object, or database table or view to one or more target tables or objects.

To create an import task, on the Import Package editor page, click the + Add task button. Note that the package should have a valid connection before creating or editing tasks. This button opens the Import Wizard. In this wizard you need to do the following three things in order to create the task:

1.Specify the source file, cloud application object, or database table or view to import data from, and, if necessary, configure data filtering.
2.Specify the target object (table) or multiple objects (tables) to import data to and the operation to apply when loading data.
3.Configure mapping of target columns to source columns, expressions, constants, loookups, etc.

note Note

Import Wizard consists of three pages: Source Definition, Target Definition, and Mapping Definition, and each of them provides settings for the corresponding action, that are listed above. You can switch between these pages by the corresponding icons in the wizard header and by clicking the Next or Previous buttons.

I. Source Settings

 

Settings for CSV File Source

1.If you are importing a local CSV file, drag your file to the drop here your file, or browse area or click the browse link and upload the CSV file to import.
 
upload-csv-file
 
If you are importing a CSV file from a file storage service select this file in the Source CSV drop-down list. This drop-down list displays folders and files from the specified source connections. You can open and close folders by clicking them.
 
For Dropbox, FTP, and SFTP storage you can also load file by the mask, that includes a date/time template. When the package runs, it will try to load a file with the current date and time substituted to the file name mask. This allows you to load a new file each time the package is executed. See Importing CSV Files via File Masks for more details.
 
file-from-dropbox
 
 
When importing data to relational databases and to some of the cloud data sources, Skyvia supports importing binary data as a ZIP archive with binary files. You can add this ZIP archive to import together with your CSV file. For example, you can import Salesforce attachments and provide the attachment bodies as files in a ZIP archive. See Importing Binary Data for more details.

note Note

Importing binary data as a ZIP archive is supported only to target fields of certain data types. See the list of the supported data types and sources in the Importing Binary Data topic.

 

2.Specify the CSV options if necessary.
 
csv-options
 
When setting CSV options, take a look on the Columns grid, which displays the list of the detected columns and allows you to explicitly specify column data types. If the columns are not correctly detected, this often means that CSV Separator, Code Page, or Text Qualifier settings are incorrect, and you need to set them to correct values.
3.If necessary, select the data types of the columns in the corresponding drop-down lists in the Columns grid. This may be necessary when you use a numeric or date/time column in Expression Mapping and its type is not determined automatically.
4.Click the Next button at the bottom right of the dialog box to open the Target Definition page.
 
 

Settings for Database or Cloud Source

1.Select the source table or object from the Object list. You may use the search box to quickly find the necessary object.
 
selecting-products-table
2.Optionally configure filters for data to import. See Filter Settings for more details.
 
import-filters-empty
3.If you import data from a cloud objects that has fields, storing its creation and last modification timestamps, you can choose to import only recently inserted or recently updated data from this object. For this, click Inserted or Updated respectively in the State Filter group. In this case the import task will import only records that were created or updated since the last package run, or, if package never ran, since the package creation. See more details in the Importing Only Recently Added or Changed Data from Cloud Sources topic.
 
import-filters-both
4.If the imported table or object has foreign keys, you can optionally join the fields of the referenced objects to the import. For this select the check boxes for the corresponding relations under the Filter settings, after Related. After this, you can use the fields of the selected related objects in mapping.
 
 
import-contact-related
 
 

II. Target Settings

1.Select the object to import data to from the Target list. If you want to import data to multiple related CRM objects or database tables, you need to select the main object first, and related objects (that have foreign key to the main one) are selected after it. You may use the search box to quickly find the necessary object.
 
single-object-product
2.If you want to import data to multiple related objects, click the Add Related button and select an object, related to the main one in the new drop-down list box. Repeat it until you add all the necessary related objects. Note that you can add not only objects, related to the first one, but objects, related to any of already added objects by clicking the Add Related button near this object. Please note that you can perform only the Insert operation into several related objects.
 
selecting-pricebookentry-multiple-objects
3.Select the type of operation for the task: Insert, Update, Delete, or Upsert. Click the corresponding button near Operation. You can find more details about UPSERT support in the Performing UPSERT Operation topic. See also Performing UPDATE and DELETE.
 
operations
4.Click the Next button at the bottom right of the dialog box to open the Mapping Definition page.

 

III. Mapping Settings

On the Mapping Definition page page you should configure mapping of target columns to source columns, expressions, constants, loookups, etc. Columns with the same names in source and target are mapped automatically.

You must map at least the target columns marked as Required in order for the task to be valid. When importing data to multiple related objects, you need to specify mapping for all the target objects (at least, their Required columns), selected on the Target Definition page. Configure mapping for the main object first, then you can select other target object in the Tables Mapping list and map the columns of this object. Repeat this for all the objects, selected on the Target Definition page.

tables-mapping-contact

The Mapping Definition page displays a grid with the target columns on the right and their mapping on the left. To map a target column, you need to click its row, then select the kind of mapping in the topmost drop-down list, and after this specify the necessary parameters for the selected kind of mapping. For the description of the available mapping kinds and their parameters see the Mapping section.

mapping-select-kind

The simplest way to import data is to map necessary target properties/columns to the source columns directly. For this, click a target property and then select the corresponding source file column in the corresponding drop-down list.

column-mapping

note Note

If you are importing data from a database table or cloud object, and you have joined the related to the imported data, you can select these columns as well as columns of the imported object or table.

note Note

When editing a task, on each of the steps you can reload metadata from source and target connections by clicking the Refresh button in the bottom left corner of the Import Wizard.