5 Replies Latest reply on Nov 13, 2014 4:15 PM by philmodjunk

    Import Records to another table

    RobinxMendoza

      Title

      Import Records to another table

      Post

      I manage to import the records one by one by click the "plus" button, see attachment. however I have no luck on creating script using "set field" and "loop" to import all records in one click of a button. I'm asking your expertise to help me in creating script using set field and loop to import all records to another table. I'm posting my script and screenshot for reference.

      Thank you very much for you time.

      Import_One_By_One.PNG

        • 1. Re: Import Records to another table
          RobinxMendoza

          Screenshot using the one by one importing of data by clicking the plus sign

          • 2. Re: Import Records to another table
            philmodjunk

            Why use a loop when you can import a found set (or the entire table) of records all with one use of the Import Records script step?

            This method can move data from one table to another in the same or different files.

            It's hard to tell what all is wrong with your script. There is no loop in your example, so we cannot identify any possible issues with your loop. It shows what might create a single records without changing layouts if the relationships are in place, but you have indicated that copying data from a single record works so it would seem that issues with why it didn't work for a large set of records might lie with details you have not chosen to share in your post.

            • 3. Re: Import Records to another table
              RobinxMendoza

              Thanks for the reply Phil please see my copyall script I can't make it to work, I know there's wrong in the script but i cant find where can you help me fix it. I'm just learning to use script in FM, thank for your guidance.

              • 4. Re: Import Records to another table
                RobinxMendoza

                 Here's the file I'm working on please see if you have time. I just wanted to import the content of LoanDetails Table (LoadDetails::LoaddetailsId) and MonthYear::MonthYearId to MonthlyPayroll Table. I've been working it for days and cant figure it out how import all the LoanDetails::LoaddetailsId and MonthYear::MonthYearId to MonthlyPayroll Table in one click of a button. One by one importing is not good if we have 500+ employees. Thanks for the help

                PS: It seems that i cant attach the file sorry..

                • 5. Re: Import Records to another table
                  philmodjunk

                  I will repeat my original suggestion that you use import records instead of the much more complex looping script.
                   If you need to add a new value to a field of all the records created by the import, you can use replace field contents to update that field for every record created by the import.