II. Import Using Existing Mask

Top  Previous  Next

   This is a variation of the above. In I (Add IDB Record), you would use your external database to create a brand new record, with each record comprising two lines, the first being the variable names and the second the data.

   With this method, you use an existing mask to supply the variable names (giving you more control over their order, spelling, composition, etc., because is it very easy to create and manipulate a mask) and the external database to create the data values only. To complete an Instant Database record, you would recall a mask (from the drop down list in the upper right of an Instant Database screen and then 'import' data from an external comma separated value (.csv or .txt) file.

   Let's discuss the steps. Most of these steps are one-time setups and will not be repeated.

   First, create an input form 'mask' that contains the variables for the typical document you want to create. See Create Mask in the main Pathagoras Manual for the instructions on the care and feeding of masks. (If you already have an established mask that you want to use, you are practically ready to roll.)

   Second, create a comma separated value file from you external database. Here are the rules:

The fields you export from your external database must be in the same order as the variables in your mask. But since the start point of the expected import need not be at the top of the mask, it just needs to be in the same order as one section of the mask.

Typically the section of the mask into which you will be importing data will be the 'whole' mask, but it need not be. Maybe it will pair up with the first 10 variables of the mask, in which case the you will create a csv file which contains 10 fields. Maybe you want to allow the user to complete the first 10 fields of the mask, and you want to be able to import data from field 11 to the end. Pathagoras can do either. Just keep in mind that the data must pair up with the desired section of the mask and the only way to accomplish that is to keep the data in the same order as the variables in the mask you wish to pair up with.

You may have to spend a little bit of time getting the data fields properly set up, but once you do, your database program should let you save it for repeat uses. (As you add more clients and customers, you will want to regenerate the file so the records are available to Pathagoras. Saving the 'export template' or whatever your database program calls it will be critically important.)
The csv file can contain an unlimited number of records -- lines -- from one to a million.
The extension of the exported file can be anything (.csv, .txt, .dat, etc.) but the file must be a true comma delimited value file.

   Third, in Pathagoras, create a pointer to the export file. This is done on via the Instant Database tab of the All Settings and Options toolbox (1). Toward the bottom of that window, click the External Database Content tab (2).

Click to enlarge.

(1)Select the Instant Database tab in the All Settings screen.
(2) Select the External Database tab in the sub-window.
(3) Check the 'Offer .csv files for import' box and
(4) navigate to the file.
Your selection will be saved in the text box to the left of the selector button.
If you wish to add a second data import link, use the lower section (5).

   That is it for the initial setup. Now, let's pretend we assembled a document. It contains variables that are collected in a Mask. Display the Instant Database screen and select the mask from the Mask list (upper left corner of the IDB form.

   Complete the data that you know is not going to be imported (or do this second). When you are ready to import data from the external file, click Power Tools and then click the 'Import' button in the Power Tools section. From the resulting screen, select the nature of the file from which you wish to import data. In this case, select the last entry, "From prepared .csv file.' this screen will appear, with the data from the first field of the primary import file already displayed.



You can easily select the secondary import file (if set)
You can navigate to any other data containing file, even if not registered.
You can use the controls at the right to designate the mask variable you wish to start import into. (Just as a reminder: You can reserve the first X number of fields in your mask for keyboard input, and take advantage of the external data to fill in the rest, or as much of 'the rest' as exists in your import file. Just select from the controls at the right the first  variable in the mask you wish to begin receiving the imported data.)