You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Select or drop the file in the **Select Source File** field. An Excel workbook can have single or multiple sheets; you can choose which sheet to import data from and specify the header row and starting data row.
46
46
47
47
***Sheet Name** – name of the worksheet from where data needs to be imported; if the Excel has multiple worksheets, their names will appear in the dropdown
48
48
***Header Row No.** – row number of the file header; the default is 1
49
49
***Read Data From Row No.** – starting line for reading data; the default is 2
Click **Preview Source Data & Entity** to view the data from the file. The first 10 data rows from the source file are shown in the data preview section. If there are less than 10 data rows in the sample file, only the available rows are shown. The column names correspond to the attribute name within the entity, and the sheet name is used to define the entity.
54
54
55
55
All the columns are automatically selected (checked) for import. You can uncheck the columns you do not want to use. At the bottom of the table, you see the target data type of the attribute, which is based on the cell-type defined in the Excel file's first data row. If any data types are incorrect, check the cell-type of the first data row and adjust the definition accordingly.
56
56
57
57
{{% alert color="warning" %}} Column names that do not adhere to Mendix naming conventions will be autocorrected. For **Number** cell-types, the target Mendix type is mapped to **Decimal** to accommodate to integers and decimals. {{% /alert %}}
@@ -77,11 +77,11 @@ All the columns are selected (checked) by default. You can uncheck the columns y
77
77
78
78
For example, for the following source data (CSV), the separator is specified as Comma and Quote, and the Escape Character is Double Quote and Header. This is already part of the input file.
@@ -93,7 +93,7 @@ You can edit the entity in the **Entity Preview** section. The Data Importer sup
93
93
94
94
Click **Edit** at top-right corner of **Entity Preview**. This will render a pop-up window where you can change the name of the entity. You can also change the name of the attribute; *Original Name* is the name of the column from input file and *Attribute Name* will be the new name that you want to assign to this column. You can also change the data type of this attribute by selecting a relevant value from the drop-down as shown below.
@@ -163,17 +163,17 @@ The **Import data from file** custom activity needs an input file to import data
163
163
2. Double-click the button and in the **Events** field under the **On click** drop-down, select **Create object** to create a `System.FileDocument` entity.
164
164
3. Pass the control to a new page (**UploadCustomerData**) where the file is uploaded.
5. Open the **Toolbox** and add a **Call microflow button**.
173
173
174
174
6. Click **New** and name the microflow *Import Customer Data*. You also see **FileDocument** in the parameters section; make sure this box is checked to include it as a parameter and click **OK**.
### Configuring the Import data from file Activity in a Microflow
179
179
@@ -183,39 +183,39 @@ The steps below are shown using an Excel input file with its corresponding Data
183
183
184
184
1. In the created microflow, drag the **Import data from file** activity into it. You can find this activity in the **Toolbox** under **Integration activities**.
To address these errors, double-click the activity and in the **File** field, choose the input file that is passed from the file upload page to this microflow as a parameter.
193
193
194
194
3. In the **Data Importer document** field, click **Select** and choose the Data Importer document you want to use.
After selecting the Data Importer document, the **Return type** and **Variable name** auto-populates. You can change the name of the output variable if you wish.
199
199
200
200
4. Click **OK**. The custom activity is configured and all the errors will resolve.
7. Set '$CustomerList' as the return value from the **Import data from file** activity to be used later. Your completed microflow should look like the image below.
8. Deploy your app locally. Browse and upload an input file, which is similar to the file that was used as a template while creating Data Importer document.
217
217
9. Check that you see a message that states **Imported xx rows from input file into a list of NPEs**.
You have successfully configured and used the Data Importer extension. You can extend this as per your requirements. For example, you can convert the list of NPEs into persistable entities by providing a message definition, or use each loop construct and individually create and commit entities into your database.
0 commit comments