Screenshot using the one by one importing of data by clicking the plus sign
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.
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.
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..
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.