1 Reply Latest reply on Mar 5, 2015 9:01 AM by philmodjunk

    Import Problem

    Gilo

      Title

      Import Problem

      Post

      Hi

       

      I have a table paiments and a clone of it paiments_copy

      I use the copy to filter records, and to delete records already in paiments

      At the end of the script i want to import records from paiments_copy into paiments. 

      So my script looks like this 

      set variable ($$file; value: Get(FilePath)
      Import Records (nodialog; "$$file"; Add; Mac Roman)

      Sorry if there are wrong commands, I use FM german.

      My problem is, I can tell him the target Table, but I cannot tell FM the source table. Even though I am in the layout paiments_copy, it takes another table and imports records which have nothing to do with paiments. Is there any solution to this problem?

        • 1. Re: Import Problem
          philmodjunk

          There is a way to get the use of that $Path variable to work and I will include a link to follow to learn that if you want, but you should not use a variable when importing data when both source and target tables (or just the table occurrences ) are in the same file.

          Instead of typing in the path name, click "Add File" in the top left corner of that dialog box, find the file in which you are creating this script and select it as the file from which you want to import data. Then select the source table from the drop down list, select target table and map fields as desired.

          For how to use the $Path variable in Import Records and still map fields and tables for the import, see the info found in the file you can download from here: Exploring the use of a $Path Variable in Scripts

          (The basic technique is to set up TWO file references in the file reference window, one that is a valid reference to an actual file and one that is the name of your $path variable. The reference to an actual file has to be valid only when creating the script step.)

          This file has a lot of info on containers, file paths, $path variables and the script steps that can use them.