How to Create Export Task
After you opened an export package details page either for an existing package or a new one, click the Add new link to open the Task Editor. Note that the package should have a valid source connection before creating or editing tasks. You should also make sure which mode you want to use in the task editor.
Skyvia offers two task editor modes for export packages — Simple and Advanced. The simple task editor mode can be used both for packages with old and new data integration runtimes. The advanced task editor mode is available only in the export packages with the new data integration runtime selected, i.e. the Use new runtime check box selected.
The advanced task editor mode allows quering data, using the Execute Command or Execute Query actions. You can enter the required SQL statements on your own or use our visual query builder tool to compose them in a simplier way.
Simple Task Editor Mode
After you click the Add new link, the task editor opens. The simple task editor mode is used in export packages by default. To configure a task, perform the following steps:
Select the exported object from the Object drop-down list.
All fields of the main object are selected by default. Below deselect check boxes next to fields you do not want to export data from. Please note you can use the Type to filter box to quickly find the necessary field names.
Note that the list contains not only the selected object’s fields, but also the fields of the objects, the selected object refers to, grouped by the object they belong to. You can expand and collapse the object field lists by clicking the corresponding object name. The check box to the left of object name allows you to select all the fields of the object (in our case it is “Account”).
Thus, you can export fields not only of the main object but also the fields of the referenced objects.
Optionally specify the target CSV file name in the Target File Name box. By default, the CSV file will have the source object name, followed by export operation timestamp if the Append timestamp to the file name check box is selected for the package. Note that if you specify a custom name, it will not be followed by the timestamp even if this check box is selected for the package; this check box is applied only for export tasks with the default file name.
Optionally, you can select the Compress Type for your file — zip or gzip. By default none compress type is selected.
- Specify the filter conditions if necessary (see how).
Specify how the data must be ordered if necessary. For this, click the Add button on the right.
In the first drop-down box, select the name of the exported object or a reference to a related object to sort data by its field.
In the second drop-down box, select the name of the field to sort the data by.
In the third drop-down box, select the sorting order — Asc (ascending) or Desc (descending). If you want to remove inserted data, click Remove.
- Click the Save button at the bottom of the Task Editor to add the created task to the package.
Advanced Task Editor Mode
To use this mode in the task editor, you need to make sure that you have selected the Use new runtime checkbox on the tab bar of your export package. Then click the Add new link to open the task editor.
Please note that Simple mode is selected by default in the task editor. To switch to the advanced mode, click Advanced under Editor Mode and select one of two possible actions. Currently, Skyvia offers the Execute Command and Execute Query actions to users. However, more actions are expected in future.
Entering SQL Statements via Command Text
Please note that Skyvia supports only SQL SELECT statements in export packages. When you select an Execute Command action, you type and edit your SQL statement directly in the Command Text box. For example, to select and export Mailchimp lists with the number of subscribed and unsubscribed members, you enter the SELECT statement as on the screenshot below.
You can also check public queries via the General Gallery in your Skyvia account. Public queries are predefined templates, which contain most common query samples. You can copy the predefined query if the one you need is available in the Gallery and paste it directly into the Command Text box and edit the way you need (if necessary). To find predefined queries, click the +NEW button in the top menu and switch to Gallery. Read more about it here.
Additionally, you may click the Open in Editor link if you need to open the command in the Query Editor. The Query Editor has the Connection Object List on the left, in which you can browse connection objects and view connection metadata in order to enter table and column names without errors in your commands. To see the fields (columns), the query returns, you can click Preview in the bottom left corner of the query editor.
If you need to add additional parameters, click icon next in the Parameters section to open the Mapping Editor. In the Mapping Editor, you can add/delete parameters, rename them, and map them using Skyvia expressions. You can read more about the Mapping Editor and how to work with it in the Actions topic.
Before saving the task, you need to specify the target file name in the Target File Name box, otherwise the task will not be saved. Then create a package and run it.
Creating Queries with Visual Query Builder
You can compose SELECT queries visually with our convenient query builder without typing a code. That is a good option if you are not much familiar with SQL. When you select an Execute Query action, the Query Model box appears. Click Open Query Builder to open and work in the Query Editor.
Query Editor allows viewing connection metadata. The Connection Object list to the left of the query editor displays the information on the metadata of available objects/tables from the source connection. You can drag a necessary table from the Connection Object List to the Result Fields pane to query its data (add it to the SELECT and FROM clauses of the SELECT statement). The Result Fields pane displays fields (columns) the query returns. By clicking a certain table, you can open and view the list of its fields.
To filter data by certain columns (i.e. to add them to the WHERE clause of the query), drag these columns from the Connection Object list to the Filters pane. Filters pane displays query filters and filter groups. Please note that query filters are type-specific, the available filters depend on the data type of the column. For example, if you need to filter Salesforce accounts by the CreatedDate column within a certain period, you simply drag the column to the Filters pane and select value to compare the field with (like equal to or between) in the Filter list on the right.
Value filters simply compare the field value with the specified one using different comparison operators or check whether the field value is NULL. Value filters are supported for all field types.
Skyvia also offers list filters and relative filters. List filters are supported for fields with string data only. Relative filters are supported for the fields with datetime data only.
You can read more about the Query Builder and how to configure queries in the Query section of our documentation.